فهرست منبع

Partially undo 3aea34db98223a45506fdca2551046d81061ed8e: double precision datatype should not be changed to double. Fix for scripted database DEFAULT values for fields

Reinier Olislagers 11 سال پیش
والد
کامیت
b737d0473e
3فایلهای تغییر یافته به همراه5 افزوده شده و 4 حذف شده
  1. 1 1
      main.pas
  2. 2 1
      scriptdb.pas
  3. 2 2
      systables.pas

+ 1 - 1
main.pas

@@ -4094,7 +4094,7 @@ begin
     12 : Result:= 'DATE';
     11 : Result:= 'D_FLOAT';
     16 : Result:= 'BIGINT'; // Probably int64 in Interbase. Further processed below
-    27 : Result:= 'DOUBLE';
+    27 : Result:= 'DOUBLE PRECISION';
     10 : Result:= 'FLOAT';
     8  : Result:= 'INTEGER'; // further processed below
     9  : Result:= 'QUAD';

+ 2 - 1
scriptdb.pas

@@ -179,6 +179,7 @@ begin
           FieldLine:= FieldLine + '(' + FieldByName('Character_Leng').AsString + ') ';
 
         // Rudimentary support for array datatypes (only covers 0 dimension types):
+        // todo: expand to proper array type detection (low priority)
         if not(FieldByName('Array_Upper_Bound').IsNull) then
           FieldLine:= FieldLine + ' [' + FieldByName('Array_Upper_Bound').AsString + '] ';
 
@@ -186,7 +187,7 @@ begin
         DefaultValue:= Trim(FieldByName('Field_Default_Value').AsString);
         if DefaultValue <> '' then
         begin
-          if pos('default', DefaultValue) <> 1 then
+          if pos('default', LowerCase(DefaultValue)) <> 1 then
             DefaultValue:= ' default ''' + DefaultValue + '''';
           FieldLine:= FieldLine + ' ' + DefaultValue;
         end;

+ 2 - 2
systables.pas

@@ -805,7 +805,7 @@ begin
       '    WHEN 14 THEN ''CHAR'' ' +
       '    WHEN 40 THEN ''CSTRING''  ' +
       '    WHEN 11 THEN ''D_FLOAT'' ' +
-      '    WHEN 27 THEN ''DOUBLE'' ' +
+      '    WHEN 27 THEN ''DOUBLE PRECISION'' ' +
       '    WHEN 10 THEN ''FLOAT'' ' +
       '    WHEN 16 THEN ''BIGINT'' ' +
       '    WHEN 8 THEN ''INTEGER'' ' +
@@ -1033,7 +1033,7 @@ begin
       '    WHEN 40 THEN ''CSTRING''  ' +
       '    WHEN 12 THEN ''DATE'' ' +
       '    WHEN 11 THEN ''D_FLOAT'' ' +
-      '    WHEN 27 THEN ''DOUBLE'' ' +
+      '    WHEN 27 THEN ''DOUBLE PRECISION'' ' +
       '    WHEN 10 THEN ''FLOAT'' ' +
       '    WHEN 16 THEN ''BIGINT'' ' +
       '    WHEN 8 THEN ''INTEGER'' ' +