From 750758a5b45202c65bf0760f04350ef13ad0ac45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Tue, 2 Aug 2011 21:26:43 +0000 Subject: [PATCH] [GB.DB.MYSQL] * NEW: Support for MyySQL 5 BIT(x) field datatype. git-svn-id: svn://localhost/gambas/trunk@3964 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.db.mysql/src/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gb.db.mysql/src/main.c b/gb.db.mysql/src/main.c index d59cdc89a..4da1ceefb 100644 --- a/gb.db.mysql/src/main.c +++ b/gb.db.mysql/src/main.c @@ -157,6 +157,14 @@ static GB_TYPE conv_type(int type, int len) return DB_T_BLOB; else return GB_T_STRING; + + case FIELD_TYPE_BIT: + if (len == 1) + return GB_T_BOOLEAN; + else if (len <= 32) + return GB_T_INTEGER; + else if (len <= 64) + return GB_T_LONG; case FIELD_TYPE_TINY_BLOB: case FIELD_TYPE_MEDIUM_BLOB: @@ -205,6 +213,7 @@ static int conv_string_type(const char *type, long *len) { "longtext", FIELD_TYPE_LONG_BLOB }, { "set", FIELD_TYPE_SET }, { "enum", FIELD_TYPE_ENUM }, + { "bit", FIELD_TYPE_BIT }, { "null", FIELD_TYPE_NULL }, { NULL, 0 }, };