mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 17:23:03 +01:00
Fix #7638 - OVERRIDING USER VALUE should be allowed for GENERATED ALWAYS AS IDENTITY.
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
912e2e18e2
commit
844631b0ee
@ -100,7 +100,6 @@ following:
|
|||||||
|
|
||||||
insert into objects (id, name) overriding system value values (11, 'Laptop');
|
insert into objects (id, name) overriding system value values (11, 'Laptop');
|
||||||
|
|
||||||
OVERRIDING also supports a subclause to be used with BY DEFAULT columns, to ignore the value passed in INSERT and use
|
OVERRIDING also supports a subclause to ignore the value passed in INSERT and use the defined sequence:
|
||||||
the defined sequence:
|
|
||||||
|
|
||||||
insert into objects (id, name) overriding user value values (12, 'Laptop'); -- 12 is not used
|
insert into objects (id, name) overriding user value values (12, 'Laptop'); -- 12 is not used
|
||||||
|
@ -359,9 +359,8 @@ int MsgPrintErr(const char* format, const SafeArg& arg, bool userFormatting)
|
|||||||
int fb_msg_format(void* handle, USHORT facility, USHORT number, unsigned int bsize, TEXT* buffer,
|
int fb_msg_format(void* handle, USHORT facility, USHORT number, unsigned int bsize, TEXT* buffer,
|
||||||
const MsgFormat::SafeArg& arg)
|
const MsgFormat::SafeArg& arg)
|
||||||
{
|
{
|
||||||
// The field MESSAGES.TEXT is 138 bytes long.
|
|
||||||
int total_msg = 0;
|
int total_msg = 0;
|
||||||
char msg[138 + 2] = "";
|
char msg[BUFFER_SMALL] = "";
|
||||||
const int n = gds__msg_lookup(handle, facility, number, sizeof(msg), msg, NULL);
|
const int n = gds__msg_lookup(handle, facility, number, sizeof(msg), msg, NULL);
|
||||||
|
|
||||||
if (n > 0 && unsigned(n) < sizeof(msg))
|
if (n > 0 && unsigned(n) < sizeof(msg))
|
||||||
|
@ -10929,14 +10929,11 @@ static void preprocessAssignments(thread_db* tdbb, CompilerScratch* csb,
|
|||||||
|
|
||||||
if (identityType == IDENT_TYPE_BY_DEFAULT && *insertOverride == OverrideClause::SYSTEM_VALUE)
|
if (identityType == IDENT_TYPE_BY_DEFAULT && *insertOverride == OverrideClause::SYSTEM_VALUE)
|
||||||
ERR_post(Arg::Gds(isc_overriding_system_invalid) << relation->rel_name);
|
ERR_post(Arg::Gds(isc_overriding_system_invalid) << relation->rel_name);
|
||||||
|
|
||||||
if (identityType == IDENT_TYPE_ALWAYS && *insertOverride == OverrideClause::USER_VALUE)
|
|
||||||
ERR_post(Arg::Gds(isc_overriding_user_invalid) << relation->rel_name);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (identityType == IDENT_TYPE_ALWAYS)
|
if (identityType == IDENT_TYPE_ALWAYS)
|
||||||
ERR_post(Arg::Gds(isc_overriding_system_missing) << relation->rel_name);
|
ERR_post(Arg::Gds(isc_overriding_missing) << relation->rel_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -814,8 +814,8 @@ FB_IMPL_MSG(JRD, 812, att_shut_db_down, -902, "08", "003", "Database is shutdown
|
|||||||
FB_IMPL_MSG(JRD, 813, att_shut_engine, -902, "08", "003", "Engine is shutdown.")
|
FB_IMPL_MSG(JRD, 813, att_shut_engine, -902, "08", "003", "Engine is shutdown.")
|
||||||
FB_IMPL_MSG(JRD, 814, overriding_without_identity, -902, "42", "000", "OVERRIDING clause can be used only when an identity column is present in the INSERT's field list for table/view @1")
|
FB_IMPL_MSG(JRD, 814, overriding_without_identity, -902, "42", "000", "OVERRIDING clause can be used only when an identity column is present in the INSERT's field list for table/view @1")
|
||||||
FB_IMPL_MSG(JRD, 815, overriding_system_invalid, -902, "42", "000", "OVERRIDING SYSTEM VALUE can be used only for identity column defined as 'GENERATED ALWAYS' in INSERT for table/view @1")
|
FB_IMPL_MSG(JRD, 815, overriding_system_invalid, -902, "42", "000", "OVERRIDING SYSTEM VALUE can be used only for identity column defined as 'GENERATED ALWAYS' in INSERT for table/view @1")
|
||||||
FB_IMPL_MSG(JRD, 816, overriding_user_invalid, -902, "42", "000", "OVERRIDING USER VALUE can be used only for identity column defined as 'GENERATED BY DEFAULT' in INSERT for table/view @1")
|
// Incorrect - FB_IMPL_MSG(JRD, 816, overriding_user_invalid, -902, "42", "000", "OVERRIDING USER VALUE can be used only for identity column defined as 'GENERATED BY DEFAULT' in INSERT for table/view @1")
|
||||||
FB_IMPL_MSG(JRD, 817, overriding_system_missing, -902, "42", "000", "OVERRIDING SYSTEM VALUE should be used to override the value of an identity column defined as 'GENERATED ALWAYS' in table/view @1")
|
FB_IMPL_MSG(JRD, 817, overriding_missing, -902, "42", "000", "OVERRIDING clause should be used when an identity column defined as 'GENERATED ALWAYS' is present in the INSERT's field list for table table/view @1")
|
||||||
FB_IMPL_MSG(JRD, 818, decprecision_err, -842, "HY", "104", "DecFloat precision must be 16 or 34")
|
FB_IMPL_MSG(JRD, 818, decprecision_err, -842, "HY", "104", "DecFloat precision must be 16 or 34")
|
||||||
FB_IMPL_MSG(JRD, 819, decfloat_divide_by_zero, -901, "22", "012", "Decimal float divide by zero. The code attempted to divide a DECFLOAT value by zero.")
|
FB_IMPL_MSG(JRD, 819, decfloat_divide_by_zero, -901, "22", "012", "Decimal float divide by zero. The code attempted to divide a DECFLOAT value by zero.")
|
||||||
FB_IMPL_MSG(JRD, 820, decfloat_inexact_result, -901, "22", "000", "Decimal float inexact result. The result of an operation cannot be represented as a decimal fraction.")
|
FB_IMPL_MSG(JRD, 820, decfloat_inexact_result, -901, "22", "000", "Decimal float inexact result. The result of an operation cannot be represented as a decimal fraction.")
|
||||||
|
@ -5496,8 +5496,7 @@ const
|
|||||||
isc_att_shut_engine = 335545133;
|
isc_att_shut_engine = 335545133;
|
||||||
isc_overriding_without_identity = 335545134;
|
isc_overriding_without_identity = 335545134;
|
||||||
isc_overriding_system_invalid = 335545135;
|
isc_overriding_system_invalid = 335545135;
|
||||||
isc_overriding_user_invalid = 335545136;
|
isc_overriding_missing = 335545137;
|
||||||
isc_overriding_system_missing = 335545137;
|
|
||||||
isc_decprecision_err = 335545138;
|
isc_decprecision_err = 335545138;
|
||||||
isc_decfloat_divide_by_zero = 335545139;
|
isc_decfloat_divide_by_zero = 335545139;
|
||||||
isc_decfloat_inexact_result = 335545140;
|
isc_decfloat_inexact_result = 335545140;
|
||||||
|
Loading…
Reference in New Issue
Block a user