mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 14:59:32 +02:00
* Better support for required in the case of "not null", default value or auto increment colomns
Patch for mysql and odbc, mantis #20429. Related to still open postgres bugreport #19872 git-svn-id: trunk@19466 -
This commit is contained in:
parent
369725f2c4
commit
eea81b4ef4
@ -666,7 +666,9 @@ begin
|
||||
|
||||
if MySQLDataType(field, DFT, DFS) then
|
||||
begin
|
||||
TFieldDef.Create(FieldDefs, FieldDefs.MakeNameUnique(field^.name), DFT, DFS, False, TF);
|
||||
TFieldDef.Create(FieldDefs, FieldDefs.MakeNameUnique(field^.name), DFT, DFS,
|
||||
(field^.flags and (AUTO_INCREMENT_FLAG or NOT_NULL_FLAG {$IFDEF MYSQL50_UP}or NO_DEFAULT_VALUE_FLAG{$ENDIF})) = (NOT_NULL_FLAG {$IFDEF MYSQL50_UP}or NO_DEFAULT_VALUE_FLAG{$ENDIF}),
|
||||
TF);
|
||||
c.MapDSRowToMSQLRow[TF-1] := I;
|
||||
inc(TF);
|
||||
end
|
||||
|
@ -1173,7 +1173,7 @@ begin
|
||||
end;
|
||||
|
||||
// add FieldDef
|
||||
TFieldDef.Create(FieldDefs, FieldDefs.MakeNameUnique(ColName), FieldType, FieldSize, False, i);
|
||||
TFieldDef.Create(FieldDefs, FieldDefs.MakeNameUnique(ColName), FieldType, FieldSize, (Nullable=SQL_NO_NULLS) and (FieldType<>ftAutoInc), i);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user