--- sql/mysql/parser3mysql.C 2012/08/31 08:33:29 1.44 +++ sql/mysql/parser3mysql.C 2015/07/28 17:10:57 1.47 @@ -15,7 +15,7 @@ #include "pa_sql_driver.h" -volatile const char * IDENT_PARSER3MYSQL_C="$Id: parser3mysql.C,v 1.44 2012/08/31 08:33:29 moko Exp $" IDENT_PA_SQL_DRIVER_H; +volatile const char * IDENT_PARSER3MYSQL_C="$Id: parser3mysql.C,v 1.47 2015/07/28 17:10:57 moko Exp $" IDENT_PA_SQL_DRIVER_H; #define NO_CLIENT_LONG_LONG #include "mysql.h" @@ -78,8 +78,10 @@ inline static bool is_column_transcode_r switch(type) { case MYSQL_TYPE_NULL: - case MYSQL_TYPE_DECIMAL: +#ifdef FIELD_TYPE_NEWDECIMAL case MYSQL_TYPE_NEWDECIMAL: +#endif + case MYSQL_TYPE_DECIMAL: case MYSQL_TYPE_FLOAT: case MYSQL_TYPE_DOUBLE: @@ -88,7 +90,9 @@ inline static bool is_column_transcode_r case MYSQL_TYPE_LONG: case MYSQL_TYPE_LONGLONG: case MYSQL_TYPE_INT24: +#ifdef FIELD_TYPE_BIT case MYSQL_TYPE_BIT: +#endif case MYSQL_TYPE_DATE: case MYSQL_TYPE_NEWDATE: @@ -131,13 +135,6 @@ public: MySQL_Driver() : SQL_Driver() {} -#ifndef FREEBSD4 - ~MySQL_Driver() { - if(mysql_server_end) - mysql_server_end(); - } -#endif - /// get api version int api_version() { return SQL_DRIVER_API_VERSION; } @@ -150,7 +147,7 @@ public: /** connect @param url format: @b user:pass@host[:port]|[/unix/socket]/database? - charset=value& // transcode by server with command 'SET CHARACTER SET value' + charset=value& // transcode by server with command 'SET NAMES value' ClientCharset=charset& // transcode by parser timeout=3& compress=0& @@ -266,7 +263,7 @@ public: } if(charset){ - char statement[MAX_STRING+1]="SET CHARACTER SET "; + char statement[MAX_STRING+1]="SET NAMES "; strncat(statement, charset, MAX_STRING); _exec(connection, statement); }