From d3a7ab53c5ea54df654296c6e781714a13022629 Mon Sep 17 00:00:00 2001 From: dimitr Date: Mon, 3 Mar 2003 19:14:06 +0000 Subject: [PATCH] Allowed UK to be created on nullable columns (SQL-99 spec). The index management code isn't ready for this yet, but appropriate changes will follow shortly. --- src/jrd/dyn_def.epp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jrd/dyn_def.epp b/src/jrd/dyn_def.epp index e415398f8f..8270e6b562 100644 --- a/src/jrd/dyn_def.epp +++ b/src/jrd/dyn_def.epp @@ -258,7 +258,7 @@ void DYN_define_constraint(GBL gbl, int all_count, unique_count; LLS field_list = NULL, list_ptr; STR str_; - USHORT found, foreign_flag = FALSE, not_null; + USHORT found, primary_flag = FALSE, foreign_flag = FALSE, not_null; UCHAR ri_action = 0; tdbb = GET_THREAD_DATA; @@ -292,6 +292,7 @@ void DYN_define_constraint(GBL gbl, switch (verb = *(*ptr)++) { case gds_dyn_def_primary_key: + primary_flag = TRUE; strcpy(CRT.RDB$CONSTRAINT_TYPE, PRIMARY_KEY); break; @@ -419,7 +420,7 @@ void DYN_define_constraint(GBL gbl, if ((FLX.RDB$NULL_FLAG.NULL || !FLX.RDB$NULL_FLAG) && (RFR.RDB$NULL_FLAG.NULL || !RFR.RDB$NULL_FLAG) && - (foreign_flag == FALSE)) { + (primary_flag == TRUE)) { not_null = FALSE; DYN_terminate(RFR.RDB$FIELD_NAME, sizeof(RFR.RDB$FIELD_NAME)); strcpy(null_field_name, RFR.RDB$FIELD_NAME);