mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-09-19 02:27:55 +08:00
Export REPID as string & use char(38) in mysql
This commit is contained in:

committed by
Jean-Michel Vourgère

parent
eaa9af89c3
commit
04b6cf5232
@@ -145,7 +145,7 @@ static MdbBackendType mdb_mysql_types[] = {
|
||||
MdbBackendType_STRUCT_ELEMENT("text",1,0,1),
|
||||
MdbBackendType_STRUCT_ELEMENT("blob",0,0,0),
|
||||
MdbBackendType_STRUCT_ELEMENT("text",1,0,1),
|
||||
MdbBackendType_STRUCT_ELEMENT("numeric",1,1,0),
|
||||
MdbBackendType_STRUCT_ELEMENT("char(38)",0,0,0),
|
||||
MdbBackendType_STRUCT_ELEMENT("numeric",1,1,0),
|
||||
};
|
||||
static MdbBackendType mdb_mysql_shortdate_type =
|
||||
|
@@ -840,6 +840,27 @@ mdb_date_to_string(MdbHandle *mdb, int start)
|
||||
return text;
|
||||
}
|
||||
|
||||
static char *
|
||||
mdb_uuid_to_string(MdbHandle *mdb, int start)
|
||||
{
|
||||
char *text = NULL;
|
||||
unsigned short uuid1, uuid2, uuid3, uuid4, uuid5, uuid6, uuid7, uuid8;
|
||||
|
||||
uuid1 = mdb_get_int16(mdb->pg_buf, start);
|
||||
uuid2 = mdb_get_int16(mdb->pg_buf, start + 2);
|
||||
uuid3 = mdb_get_int16(mdb->pg_buf, start + 4);
|
||||
uuid4 = mdb_get_int16(mdb->pg_buf, start + 6);
|
||||
uuid5 = mdb_get_int16(mdb->pg_buf, start + 8);
|
||||
uuid6 = mdb_get_int16(mdb->pg_buf, start + 10);
|
||||
uuid7 = mdb_get_int16(mdb->pg_buf, start + 12);
|
||||
uuid8 = mdb_get_int16(mdb->pg_buf, start + 14);
|
||||
|
||||
text = g_strdup_printf("{%04x%04x-%04x-%04x-%04x-%04x%04x%04x}",
|
||||
uuid1, uuid2, uuid3, uuid4, uuid5, uuid6, uuid7, uuid8);
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
#if 0
|
||||
int floor_log10(double f, int is_single)
|
||||
{
|
||||
@@ -927,6 +948,9 @@ char *mdb_col_to_string(MdbHandle *mdb, void *buf, int start, int datatype, int
|
||||
text = mdb_money_to_string(mdb, start);
|
||||
case MDB_NUMERIC:
|
||||
break;
|
||||
case MDB_REPID:
|
||||
text = mdb_uuid_to_string(mdb, start);
|
||||
break;
|
||||
default:
|
||||
text = g_strdup("");
|
||||
break;
|
||||
|
@@ -25,8 +25,8 @@
|
||||
#undef MDB_BIND_SIZE
|
||||
#define MDB_BIND_SIZE 200000
|
||||
|
||||
#define is_quote_type(x) (x==MDB_TEXT || x==MDB_OLE || x==MDB_MEMO || x==MDB_DATETIME || x==MDB_BINARY)
|
||||
#define is_binary_type(x) (x==MDB_OLE || x==MDB_BINARY)
|
||||
#define is_quote_type(x) (x==MDB_TEXT || x==MDB_OLE || x==MDB_MEMO || x==MDB_DATETIME || x==MDB_BINARY || x==MDB_REPID)
|
||||
#define is_binary_type(x) (x==MDB_OLE || x==MDB_BINARY || x==MDB_REPID)
|
||||
|
||||
static char *escapes(char *s);
|
||||
|
||||
|
Reference in New Issue
Block a user