--- sql/sqlite/parser3sqlite.C 2008/06/30 09:29:55 1.8 +++ sql/sqlite/parser3sqlite.C 2008/07/03 07:17:25 1.9 @@ -3,7 +3,7 @@ (c) Dmitry "Creator" Bobrik, 2004 */ -//static const char *RCSId="$Id: parser3sqlite.C,v 1.8 2008/06/30 09:29:55 misha Exp $"; +//static const char *RCSId="$Id: parser3sqlite.C,v 1.9 2008/07/03 07:17:25 misha Exp $"; #include "config_includes.h" @@ -14,6 +14,7 @@ #include "sqlite3.h" #include "ltdl.h" +#define MAX_COLS 500 #define MAX_STRING 0x400 #define MAX_NUMBER 20 @@ -112,9 +113,9 @@ public: services._throw("document_root is empty"); db_path=(char*)services.malloc_atomic(strlen(document_root)+1+strlen(db)+1); - db_path=strcpy(db_path, document_root); - db_path=strcat(db_path, "/"); - db_path=strcat(db_path, db); + strcpy(db_path, document_root); + strcat(db_path, "/"); + strcat(db_path, db); } //services._throw(db_path); @@ -222,7 +223,9 @@ public: if(placeholders_count>0) services._throw("bind variables not supported yet"); - + + const char* request_charset=services.request_charset(); + const char* client_charset=connection.client_charset; bool transcode_needed=_transcode_required(connection); // transcode query from $request:charset to ?ClientCharset @@ -230,8 +233,8 @@ public: size_t length=strlen(astatement); services.transcode(astatement, length, astatement, length, - services.request_charset(), - connection.client_charset); + request_charset, + client_charset); } const char *statement; @@ -278,6 +281,12 @@ public: if(!column_count){ // empty result: insert|delete|update|... rc=sqlite3_step(SQL); } else { + if(column_count>MAX_COLS) + column_count=MAX_COLS; + + int column_types[MAX_COLS]; + bool transcode_column[MAX_COLS]; + for(int i=0; i