New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem in table changes [CORE5019] #5307
Comments
Commented by: @pavel-zotov Can`t reproduce: create table sm_cd_mo_movimentador_cl_v ( alter table sm_cd_mo_movimentador_cl_v drop latitude; alter table sm_cd_mo_movimentador_cl_v show table sm_cd_mo_movimentador_cl_v; show version; |
Commented by: @pavel-zotov PS. Did you add some data after CREATE and before 1st ALTER table statement ? |
Modified by: @dyemanovsecurity: Developers [ 10012 ] => |
Commented by: Workdev Tecnologia da Informação LTDA (workdev) table set up at another time and contains data create table sm_cd_mo_movimentador_cl_v ( INSERT INTO SM_CD_MO_MOVIMENTADOR_CL_V (EMPRESA, COD, COLABORADOR, REGIAO, REGIAO_SEQUENCIA, ROTA, ROTA_SEQUENCIA, ROTA_DIA_DA_SEMANA, ROTA_FREQUENCIA_SEMANA, LATITUDE, LONGITUDE, TABELA_PRECO, TRANSPORTADOR, TIPO_FRETE) COMMIT WORK; made modifications alter table sm_cd_mo_movimentador_cl_v drop latitude; alter table sm_cd_mo_movimentador_cl_v That time is giving error |
Commented by: @dyemanov As designed. Adding NOT NULL columns over a populated table is not allowed anymore, because such operations violate the NOT NULL constraint. You may forget to update the new fields with non-NULL values and get unrestorable backup as a result. Now you must specify DEFAULT clauses for all the new columns added this way. You correctly do that for "latitude_new" and "longitude_new" columns, but not for "empresa_new" and "cod_new" ones. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Workdev Tecnologia da Informação LTDA (workdev)
Is related to CORE1518
CREATE TABLE SM_CD_MO_MOVIMENTADOR_CL_V (
EMPRESA INTEGER,
COD INTEGER,
COLABORADOR INTEGER,
REGIAO INTEGER,
REGIAO_SEQUENCIA INTEGER DEFAULT 0 NOT NULL,
ROTA INTEGER,
ROTA_SEQUENCIA INTEGER DEFAULT 0 NOT NULL,
ROTA_DIA_DA_SEMANA SMALLINT DEFAULT 0 NOT NULL,
ROTA_FREQUENCIA_SEMANA SMALLINT DEFAULT 0 NOT NULL,
LATITUDE NUMERIC(18,0) DEFAULT 0 NOT NULL,
LONGITUDE NUMERIC(18,0) DEFAULT 0 NOT NULL,
TABELA_PRECO INTEGER,
TRANSPORTADOR INTEGER,
TIPO_FRETE SMALLINT DEFAULT 0 NOT NULL
);
ALTER TABLE SM_CD_MO_MOVIMENTADOR_CL_V DROP LATITUDE;
ALTER TABLE SM_CD_MO_MOVIMENTADOR_CL_V DROP LONGITUDE;
ALTER TABLE SM_CD_MO_MOVIMENTADOR_CL_V
ADD PRACA INTEGER,
ADD EMPRESA_NEW INTEGER NOT NULL,
ADD COD_NEW INTEGER NOT NULL,
ADD LATITUDE_NEW VARCHAR(18) CHARACTER SET NONE DEFAULT '' NOT NULL,
ADD LONGITUDE_NEW VARCHAR(18) CHARACTER SET NONE DEFAULT '' NOT NULL;
can't format message 13:393 -- message file C:\Windows\SYSTEM32\firebird.msg not found.
unsuccessful metadata update.
Cannot make field EMPRESA_NEW of table SM_CD_MO_MOVIMENTADOR_CL_V NOT NULL because there are NULLs present.
Cannot make field COD_NEW of table SM_CD_MO_MOVIMENTADOR_CL_V NOT NULL because there are NULLs present.
The text was updated successfully, but these errors were encountered: