further DEBUG:
in the first FOR loop the
Code: Select all
ZPlainMySql5.PMYSQL_FIELD(Field)^.flags
is a 7, in the second loop it is 3120579657;
PMYSQL_FIELD.flags is cardinal type, look below; but the GetfieldFlags function returns an Integer - there is the ERangeError...?
This is from ZPlainMySql5.pas:
Code: Select all
PMYSQL_FIELD = ^MYSQL_FIELD;
MYSQL_FIELD = record
name: PChar; // Name of column
org_name: PChar; // Original column name, if an alias
table: PChar; // Table of column if column was a field
org_table: PChar; // Org table name if table was an alias
db: PChar; // Database for table
catalog: PChar; // Catalog for table
def: PChar; // Default value (set by mysql_list_fields)
length: LongInt; // Width of column
max_length: LongInt; // Max width of selected set
name_length: Cardinal;
org_name_length: Cardinal;
table_length: Cardinal;
org_table_length: Cardinal;
db_length: Cardinal;
catalog_length: Cardinal;
def_length: Cardinal;
flags: Cardinal; // Div flags
decimals: Cardinal; // Number of decimals in field
charsetnr: Cardinal; // Character set
_type: Cardinal; // Type of field. Se mysql_com.h for types
end;
BUT: 3120579657 ? Could that be? I don't know anything about the MySQL protocol - is that a possible value for the flags field?
And Why ERangeError? Cardinal and Integer are both 32bit, just signed/unsigned.
would it help to do an
Code: Select all
Result := Integer(ZPlainMySql5.PMYSQL_FIELD(Field)^.flags);