//gcc bug47012.c -Wall -g -o bug47012 -L/home/sbester/mysql/5.1/mysql-advanced-gpl-5.1.39-linux-i686-glibc23/lib -I/home/sbester/mysql/5.1/mysql-advanced-gpl-5.1.39-linux-i686-glibc23/include -lmysqlclient_r -lz -lm -lpthread #include <unistd.h> #include <pthread.h> #include <string.h> #include <stdlib.h> #include <time.h> #include <mysql.h> #include <stdio.h> #define TESTTIME (3600) #define NUMTHREADS (7) #define DATASIZE (16*1024*1024) char host[]="192.168.1.100"; int port=3306; char username[]="root"; char password[]=""; char database[]="test"; pthread_t pthreads[NUMTHREADS]; unsigned long client_version=0; unsigned long server_version=0; unsigned long num_queries=0; int threaddone=0; char *databucket=NULL; int db_query(MYSQL *dbc,char *sql,int showresults); char* alocmem(size_t num); int write_string(char *buf,const size_t minlen,const size_t maxlen); /* prepared statement function declarations: 4 */ int ps_func_0000(MYSQL *db); int ps_func_0001(MYSQL *db); int ps_func_0002(MYSQL *db); int ps_func_0003(MYSQL *db); void *worker_thread(void *arg) { MYSQL *dbc=NULL; my_bool auto_reconnect=1; int cancelstate=0; pthread_setcancelstate(PTHREAD_CANCEL_DISABLE,&cancelstate); dbc = mysql_init(NULL); if(NULL == dbc) { printf("mysql_init failed\n"); goto threadexit; } else { if(0!=mysql_options(dbc,MYSQL_OPT_RECONNECT,(char*)&auto_reconnect)) { printf("mysql_options() failed to set MYSQL_OPT_RECONNECT"); } if (!mysql_real_connect(dbc,host,username,password,database,port, NULL, CLIENT_FOUND_ROWS|CLIENT_MULTI_STATEMENTS|CLIENT_MULTI_RESULTS)) { printf("mysql_real_connect failed: %s (%d) (%s)", mysql_error(dbc),mysql_errno(dbc),mysql_sqlstate(dbc)); mysql_close(dbc); dbc=NULL; } } char shortquery[1024]; memset(shortquery,0,1024); char *longquery; longquery=NULL; char *c; c=NULL; while(0==threaddone && NULL!=dbc) { if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","set session read_buffer_size=abs("); c+=sprintf(c,"%ld",-8388608 + lrand48()%16777215lu); c+=sprintf(c,"%s",")"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { longquery = alocmem(820570); c=longquery; c+=sprintf(c,"%s","insert ignore into `table0000` set `col00`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col01`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col02`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col03`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,409600); c+=sprintf(c,"%s","'),`col04`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%ld",1901 + lrand48()%254lu); c+=sprintf(c,"%s","'),`col05`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col06`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")"); db_query(dbc,longquery,0); free(longquery); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","select * from `table0000` limit 1"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { //select * from `table0000` limit 1 ps_func_0000(dbc); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/show full columns from `table0000`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/analyze table `table0000`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/optimize table `table0000`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/check table `table0000`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/alter table `table0000` engine=archive"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/flush table `table0000`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/checksum table `table0000`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { longquery = alocmem(5409944); c=longquery; c+=sprintf(c,"%s","insert ignore into `table0001` set `col00`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col01`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col02`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col03`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%ld",1901 + lrand48()%254lu); c+=sprintf(c,"%s","'),`col04`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col05`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,209600); c+=sprintf(c,"%s","'),`col06`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,209600); c+=sprintf(c,"%s","'),`col07`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col08`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col09`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1))); c+=sprintf(c,"%s","'),`col10`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col11`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col12`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col13`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col14`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col15`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col16`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col17`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col18`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col19`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,209600); c+=sprintf(c,"%s","'),`col20`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,209600); c+=sprintf(c,"%s","'),`col21`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col22`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,209600); c+=sprintf(c,"%s","'),`col23`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col24`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col25`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,209600); c+=sprintf(c,"%s","'),`col26`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col27`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col28`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col29`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,209600); c+=sprintf(c,"%s","'),`col30`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,4096); c+=sprintf(c,"%s","'),`col31`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col32`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col33`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1))); c+=sprintf(c,"%s","'),`col34`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col35`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col36`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col37`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col38`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col39`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col40`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col41`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col42`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%ld",1901 + lrand48()%254lu); c+=sprintf(c,"%s","'),`col43`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col44`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col45`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col46`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col47`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col48`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col49`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col50`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col51`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col52`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col53`='"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1970 + (lrand48()%(2038-1970)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)), (lrand48()%(24-0)), (lrand48()%(60-0)),(lrand48()%(60-0))); c+=sprintf(c,"%s","',`col54`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,409600); c+=sprintf(c,"%s","'),`col55`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col56`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col57`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col58`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col59`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1))); c+=sprintf(c,"%s","'),`col60`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col61`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,409600); c+=sprintf(c,"%s","'),`col62`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,409600); c+=sprintf(c,"%s","'),`col63`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")"); db_query(dbc,longquery,0); free(longquery); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","select * from `table0001` limit 1"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { //select * from `table0001` limit 1 ps_func_0001(dbc); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/show full columns from `table0001`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/analyze table `table0001`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/optimize table `table0001`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/check table `table0001`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/alter table `table0001` engine=archive"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/flush table `table0001`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/checksum table `table0001`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { longquery = alocmem(3322641); c=longquery; c+=sprintf(c,"%s","insert ignore into `table0002` set `col00`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col01`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,209600); c+=sprintf(c,"%s","'),`col02`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col03`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col04`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,409600); c+=sprintf(c,"%s","'),`col05`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col06`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col07`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col08`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col09`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col10`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col11`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col12`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col13`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col14`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col15`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col16`='"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1970 + (lrand48()%(2038-1970)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)), (lrand48()%(24-0)), (lrand48()%(60-0)),(lrand48()%(60-0))); c+=sprintf(c,"%s","',`col17`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col18`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col19`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,409600); c+=sprintf(c,"%s","'),`col20`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col21`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col22`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col23`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col24`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col25`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col26`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col27`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col28`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col29`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col30`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col31`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col32`='"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1970 + (lrand48()%(2038-1970)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)), (lrand48()%(24-0)), (lrand48()%(60-0)),(lrand48()%(60-0))); c+=sprintf(c,"%s","',`col33`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col34`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col35`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,4096); c+=sprintf(c,"%s","'),`col36`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%ld",1901 + lrand48()%254lu); c+=sprintf(c,"%s","'),`col37`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col38`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col39`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col40`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col41`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col42`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col43`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,4096); c+=sprintf(c,"%s","'),`col44`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%ld",1901 + lrand48()%254lu); c+=sprintf(c,"%s","'),`col45`='"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1970 + (lrand48()%(2038-1970)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)), (lrand48()%(24-0)), (lrand48()%(60-0)),(lrand48()%(60-0))); c+=sprintf(c,"%s","',`col46`='"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1970 + (lrand48()%(2038-1970)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)), (lrand48()%(24-0)), (lrand48()%(60-0)),(lrand48()%(60-0))); c+=sprintf(c,"%s","',`col47`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col48`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col49`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col50`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%ld",1901 + lrand48()%254lu); c+=sprintf(c,"%s","'),`col51`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1))); c+=sprintf(c,"%s","'),`col52`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col53`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col54`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col55`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col56`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col57`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col58`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col59`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col60`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,409600); c+=sprintf(c,"%s","'),`col61`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%ld",1901 + lrand48()%254lu); c+=sprintf(c,"%s","'),`col62`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col63`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,209600); c+=sprintf(c,"%s","'),`col64`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%ld",1901 + lrand48()%254lu); c+=sprintf(c,"%s","'),`col65`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col66`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col67`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col68`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col69`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col70`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col71`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col72`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col73`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col74`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col75`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col76`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col77`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")"); db_query(dbc,longquery,0); free(longquery); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","select * from `table0002` limit 1"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { //select * from `table0002` limit 1 ps_func_0002(dbc); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/show full columns from `table0002`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/analyze table `table0002`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/optimize table `table0002`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/check table `table0002`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/alter table `table0002` engine=archive"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/flush table `table0002`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/checksum table `table0002`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { longquery = alocmem(5774722); c=longquery; c+=sprintf(c,"%s","insert ignore into `table0003` set `col00`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col01`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col02`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col03`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col04`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,409600); c+=sprintf(c,"%s","'),`col05`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col06`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col07`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col08`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col09`='"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1970 + (lrand48()%(2038-1970)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)), (lrand48()%(24-0)), (lrand48()%(60-0)),(lrand48()%(60-0))); c+=sprintf(c,"%s","',`col10`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col11`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col12`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col13`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col14`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col15`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,4096); c+=sprintf(c,"%s","'),`col16`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col17`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col18`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col19`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,409600); c+=sprintf(c,"%s","'),`col20`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col21`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col22`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col23`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col24`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col25`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col26`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col27`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,409600); c+=sprintf(c,"%s","'),`col28`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col29`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col30`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col31`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col32`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col33`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col34`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col35`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col36`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col37`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col38`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,409600); c+=sprintf(c,"%s","'),`col39`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col40`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col41`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col42`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col43`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col44`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col45`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col46`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col47`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col48`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col49`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,209600); c+=sprintf(c,"%s","'),`col50`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col51`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col52`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col53`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%ld",1901 + lrand48()%254lu); c+=sprintf(c,"%s","'),`col54`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,209600); c+=sprintf(c,"%s","'),`col55`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col56`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col57`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col58`='"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1970 + (lrand48()%(2038-1970)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)), (lrand48()%(24-0)), (lrand48()%(60-0)),(lrand48()%(60-0))); c+=sprintf(c,"%s","',`col59`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1000 + (lrand48()%(9999-1000)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)),(lrand48()%(24-0)),(lrand48()%(60-0)),(lrand48()%(60))); c+=sprintf(c,"%s","'),`col60`='"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1970 + (lrand48()%(2038-1970)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)), (lrand48()%(24-0)), (lrand48()%(60-0)),(lrand48()%(60-0))); c+=sprintf(c,"%s","',`col61`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col62`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col63`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col64`=if(abs("); c+=sprintf(c,"%ld",-2147483647 + lrand48()%4294967294lu); c+=sprintf(c,"%s",")%100<20,null,repeat('"); c+=write_string(c,0,255); c+=sprintf(c,"%s","',abs("); c+=sprintf(c,"%ld",-128 + lrand48()%255lu); c+=sprintf(c,"%s","))),`col65`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,409600); c+=sprintf(c,"%s","'),`col66`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,409600); c+=sprintf(c,"%s","'),`col67`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col68`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col69`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col70`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col71`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col72`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=write_string(c,0,255); c+=sprintf(c,"%s","'),`col73`='"); c+=sprintf(c,"%04ld-%02ld-%02ld %02ld:%02ld:%02ld",1970 + (lrand48()%(2038-1970)),01 + (lrand48()%(12-1)),01 + (lrand48()%(31-1)), (lrand48()%(24-0)), (lrand48()%(60-0)),(lrand48()%(60-0))); c+=sprintf(c,"%s","',`col74`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,'"); c+=sprintf(c,"%ld",1901 + lrand48()%254lu); c+=sprintf(c,"%s","'),`col75`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s","),`col76`=if(abs("); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")%100<20,null,"); c+=sprintf(c,"%ld",-32768 + lrand48()%65535lu); c+=sprintf(c,"%s",")"); db_query(dbc,longquery,0); free(longquery); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","select * from `table0003` limit 1"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { //select * from `table0003` limit 1 ps_func_0003(dbc); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/show full columns from `table0003`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/analyze table `table0003`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/optimize table `table0003`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/check table `table0003`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/alter table `table0003` engine=archive"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/flush table `table0003`"); db_query(dbc,shortquery,1); } if(lrand48()%7==0) { c=shortquery; c+=sprintf(c,"%s","/*extreme*/checksum table `table0003`"); db_query(dbc,shortquery,1); } } threadexit: mysql_close(dbc); mysql_thread_end(); pthread_exit(0); } int main(int argc, const char *argv[]) { MYSQL *dbc=NULL; int i=0,err=0; srand48((unsigned long)1255069475); time_t timestart=0,timenow=0; unsigned int counter=0; counter=0; char shortquery[1024]={0}; char *longquery=NULL; longquery=NULL; char *c=NULL; my_init(); if (!(dbc = mysql_init(NULL))) { printf("mysql_init failed\n"); dbc=NULL; goto threadexit; } else { if (!mysql_real_connect(dbc,host,username,password,database,port, NULL, CLIENT_FOUND_ROWS|CLIENT_MULTI_STATEMENTS|CLIENT_MULTI_RESULTS)) { printf("mysql_real_connect failed: %s (%d) (%s)", mysql_error(dbc),mysql_errno(dbc),mysql_sqlstate(dbc)); mysql_close(dbc); dbc=NULL; goto threadexit; } } printf("running initializations..\n"); client_version=mysql_get_client_version(); server_version=mysql_get_server_version(dbc); printf("client version=%lu\n",client_version); printf("server version=%lu\n",server_version); if((client_version/10000) < (server_version/10000)) { printf("different client and server version! please upgrade client library!\n"); //goto threadexit; } if (!mysql_thread_safe()) { printf("non-threadsafe client detected! please rebuild and link with libmysql_r!\n"); } printf("pre-generating %d bytes of random data\n",DATASIZE); databucket=(char*)calloc(DATASIZE,sizeof(char*)); if(NULL == databucket) { printf("error: cannot calloc data buffer.\n"); exit(1); } for(i=0;i<DATASIZE-1;i++) { databucket[i]=0x61+(lrand48()%26); } c=shortquery; c+=sprintf(c,"%s","set global max_allowed_packet=1024*1024*100"); db_query(dbc,shortquery,1); c=shortquery; c+=sprintf(c,"%s","drop table if exists `table0000`"); db_query(dbc,shortquery,1); c=shortquery; c+=sprintf(c,"%s","CREATE TABLE `table0000` ( `col00` float DEFAULT NULL, `col01` char(246) DEFAULT NULL, `col02` tinyint(4) DEFAULT NULL, `col03` longtext, `col04` year(4) DEFAULT NULL, `col05` char(203) DEFAULT NULL, `col06` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 COMMENT='generated'"); db_query(dbc,shortquery,1); c=shortquery; c+=sprintf(c,"%s","drop table if exists `table0001`"); db_query(dbc,shortquery,1); longquery = alocmem(2043); c=longquery; c+=sprintf(c,"%s","CREATE TABLE `table0001` ( `col00` tinyint(4) DEFAULT NULL, `col01` double DEFAULT NULL, `col02` varchar(195) DEFAULT NULL, `col03` year(4) DEFAULT NULL, `col04` mediumint(9) DEFAULT NULL, `col05` mediumtext, `col06` mediumtext, `col07` double DEFAULT NULL, `col08` tinyint(4) DEFAULT NULL, `col09` date DEFAULT NULL, `col10` varchar(28) DEFAULT NULL, `col11` double DEFAULT NULL, `col12` datetime DEFAULT NULL, `col13` datetime DEFAULT NULL, `col14` time DEFAULT NULL, `col15` datetime DEFAULT NULL, `col16` time DEFAULT NULL, `col17` blob, `col18` datetime DEFAULT NULL, `col19` mediumtext, `col20` mediumtext, `col21` longblob, `col22` mediumtext, `col23` tinytext, `col24` tinyint(4) DEFAULT NULL, `col25` mediumtext, `col26` double DEFAULT NULL, `col27` double DEFAULT NULL, `col28` varchar(20) DEFAULT NULL, `col29` mediumtext, `col30` text, `col31` char(146) DEFAULT NULL, `col32` float DEFAULT NULL, `col33` date DEFAULT NULL, `col34` double DEFAULT NULL, `col35` mediumblob, `col36` double DEFAULT NULL, `col37` decimal(10,0) DEFAULT NULL, `col38` decimal(10,0) DEFAULT NULL, `col39` tinyint(4) DEFAULT NULL, `col40` mediumint(9) DEFAULT NULL, `col41` decimal(10,0) DEFAULT NULL, `col42` year(4) DEFAULT NULL, `col43` varchar(174) DEFAULT NULL, `col44` int(11) DEFAULT NULL, `col45` longblob, `col46` datetime DEFAULT NULL, `col47` bigint(20) DEFAULT NULL, `col48` double DEFAULT NULL, `col49` bigint(20) DEFAULT NULL, `col50` tinyblob, `col51` decimal(10,0) DEFAULT NULL, `col52` decimal(10,0) DEFAULT NULL, `col53` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `col54` longtext, `col55` int(11) DEFAULT NULL, `col56` tinyint(1) DEFAULT NULL, `col57` longblob, `col58` datetime DEFAULT NULL, `col59` date DEFAULT NULL, `col60` char(13) DEFAULT NULL, `col61` longtext, `col62` longtext, `col63` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 COMMENT='generated'"); db_query(dbc,longquery,0); free(longquery); c=shortquery; c+=sprintf(c,"%s","drop table if exists `table0002`"); db_query(dbc,shortquery,1); longquery = alocmem(2568); c=longquery; c+=sprintf(c,"%s","CREATE TABLE `table0002` ( `col00` varchar(37) DEFAULT NULL, `col01` mediumtext, `col02` tinyint(4) DEFAULT NULL, `col03` bigint(20) DEFAULT NULL, `col04` longtext, `col05` tinyint(4) DEFAULT NULL, `col06` int(11) DEFAULT NULL, `col07` time DEFAULT NULL, `col08` mediumint(9) DEFAULT NULL, `col09` double DEFAULT NULL, `col10` time DEFAULT NULL, `col11` bigint(20) DEFAULT NULL, `col12` double DEFAULT NULL, `col13` double DEFAULT NULL, `col14` char(64) DEFAULT NULL, `col15` double DEFAULT NULL, `col16` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `col17` int(11) DEFAULT NULL, `col18` tinyint(4) DEFAULT NULL, `col19` longtext, `col20` char(145) DEFAULT NULL, `col21` tinytext, `col22` bigint(20) DEFAULT NULL, `col23` decimal(10,0) DEFAULT NULL, `col24` double DEFAULT NULL, `col25` char(197) DEFAULT NULL, `col26` tinyblob, `col27` tinyint(4) DEFAULT NULL, `col28` int(11) DEFAULT NULL, `col29` double DEFAULT NULL, `col30` double DEFAULT NULL, `col31` tinyint(1) DEFAULT NULL, `col32` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col33` tinytext, `col34` tinyblob, `col35` text, `col36` year(4) DEFAULT NULL, `col37` time DEFAULT NULL, `col38` longblob, `col39` tinyint(4) DEFAULT NULL, `col40` double DEFAULT NULL, `col41` mediumint(9) DEFAULT NULL, `col42` double DEFAULT NULL, `col43` text, `col44` year(4) DEFAULT NULL, `col45` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col46` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col47` decimal(10,0) DEFAULT NULL, `col48` tinytext, `col49` datetime DEFAULT NULL, `col50` year(4) DEFAULT NULL, `col51` date DEFAULT NULL, `col52` time DEFAULT NULL, `col53` mediumint(9) DEFAULT NULL, `col54` mediumint(9) DEFAULT NULL, `col55` mediumint(9) DEFAULT NULL, `col56` double DEFAULT NULL, `col57` float DEFAULT NULL, `col58` double DEFAULT NULL, `col59` int(11) DEFAULT NULL, `col60` longtext, `col61` year(4) DEFAULT NULL, `col62` int(11) DEFAULT NULL, `col63` mediumtext, `col64` year(4) DEFAULT NULL, `col65` tinytext, `col66` int(11) DEFAULT NULL, `col67` double DEFAULT NULL, `col68` int(11) DEFAULT NULL, `col69` bigint(20) DEFAULT NULL, `col70` tinyint(4) DEFAULT NULL, `col71` double DEFAULT NULL, `col72` blob, `col73` time DEFAULT NULL, `col74` double DEFAULT NULL, `col75` double DEFAULT NULL, `col76` tinyblob, `col77` tinyint(4) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 COMMENT='generated'"); db_query(dbc,longquery,0); free(longquery); c=shortquery; c+=sprintf(c,"%s","drop table if exists `table0003`"); db_query(dbc,shortquery,1); longquery = alocmem(2478); c=longquery; c+=sprintf(c,"%s","CREATE TABLE `table0003` ( `col00` datetime DEFAULT NULL, `col01` datetime DEFAULT NULL, `col02` double DEFAULT NULL, `col03` decimal(10,0) DEFAULT NULL, `col04` longtext, `col05` bigint(20) DEFAULT NULL, `col06` double DEFAULT NULL, `col07` bigint(20) DEFAULT NULL, `col08` char(99) DEFAULT NULL, `col09` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `col10` double DEFAULT NULL, `col11` mediumint(9) DEFAULT NULL, `col12` datetime DEFAULT NULL, `col13` double DEFAULT NULL, `col14` blob, `col15` text, `col16` tinytext, `col17` int(11) DEFAULT NULL, `col18` varchar(153) DEFAULT NULL, `col19` longtext, `col20` tinyint(1) DEFAULT NULL, `col21` double DEFAULT NULL, `col22` double DEFAULT NULL, `col23` double DEFAULT NULL, `col24` tinyint(1) DEFAULT NULL, `col25` tinyint(1) DEFAULT NULL, `col26` bigint(20) DEFAULT NULL, `col27` longtext, `col28` bigint(20) DEFAULT NULL, `col29` blob, `col30` varchar(110) DEFAULT NULL, `col31` mediumint(9) DEFAULT NULL, `col32` double DEFAULT NULL, `col33` longblob, `col34` datetime DEFAULT NULL, `col35` char(229) DEFAULT NULL, `col36` double DEFAULT NULL, `col37` longblob, `col38` longtext, `col39` mediumblob, `col40` mediumblob, `col41` longblob, `col42` decimal(10,0) DEFAULT NULL, `col43` tinyint(1) DEFAULT NULL, `col44` float DEFAULT NULL, `col45` datetime DEFAULT NULL, `col46` float DEFAULT NULL, `col47` char(126) DEFAULT NULL, `col48` double DEFAULT NULL, `col49` mediumtext, `col50` datetime DEFAULT NULL, `col51` mediumint(9) DEFAULT NULL, `col52` blob, `col53` year(4) DEFAULT NULL, `col54` mediumtext, `col55` blob, `col56` double DEFAULT NULL, `col57` double DEFAULT NULL, `col58` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col59` time DEFAULT NULL, `col60` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col61` longblob, `col62` double DEFAULT NULL, `col63` tinyint(4) DEFAULT NULL, `col64` blob, `col65` longtext, `col66` longtext, `col67` double DEFAULT NULL, `col68` int(11) DEFAULT NULL, `col69` tinyint(4) DEFAULT NULL, `col70` double DEFAULT NULL, `col71` tinyint(4) DEFAULT NULL, `col72` char(204) DEFAULT NULL, `col73` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col74` year(4) DEFAULT NULL, `col75` float DEFAULT NULL, `col76` double DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 COMMENT='generated'"); db_query(dbc,longquery,0); free(longquery); mysql_close(dbc); printf("about to spawn %d threads\n",NUMTHREADS); for (i=0;i<NUMTHREADS;i++) { err=pthread_create(&pthreads[i], NULL, worker_thread, (void *)i); if(err!=0) { printf("error spawning thread %lu, pthread_create returned %lu\n",(unsigned long)i,(unsigned long)err); } printf("."); } printf("\n"); printf("completed spawning new database worker threads\n"); printf("testcase is now running, so watch for error output\n"); timestart=time(NULL); timenow=time(NULL); for(i=0;(timenow-timestart) < TESTTIME;timenow=time(NULL)) { usleep(1000*1000); printf("queries: %09lu\n",num_queries); } threaddone=1; printf("waiting for worker threads to finish...\n"); for (i=0;i<NUMTHREADS;i++) { pthread_join(pthreads[i], NULL); } if(NULL!=databucket)free(databucket); exit(0); threadexit: exit(-1); } int db_query(MYSQL *dbc,char *sql,int showresults) { int res=0; MYSQL_RES *r=NULL; MYSQL_ROW w; MYSQL_FIELD *field=NULL; int moreresult=0; unsigned int i=0; unsigned int myerrno=0; if(NULL == dbc) return 0; res = mysql_query(dbc,sql); if(res != 0 && showresults > 0) { myerrno=mysql_errno(dbc); printf("query failed '%s' : %d (%s) (%s)\n",sql,myerrno,mysql_error(dbc),mysql_sqlstate(dbc)); return 0; } num_queries++; do { r = mysql_use_result(dbc); if(r) { unsigned int numfields = mysql_num_fields(r); //unsigned int numrows=mysql_num_rows(r); while(0!=(field = mysql_fetch_field(r))) { //print metadata information about each field if(showresults > 1) { printf("%s ",field->name); } } if(showresults > 1) { printf("\n------------------------------------\n"); } while (0!=(w = mysql_fetch_row(r))) { for(i = 0; i < numfields; i++) { //print each field here if(showresults > 1) { printf("%s\t",w[i]); } } if(showresults > 1) { printf("\n"); } } if(showresults > 1) { printf("\n"); } mysql_free_result(r); } else //no rows returned. was it a select? { if(mysql_field_count(dbc) > 0 && showresults > 0) { printf("No results for '%s'. (%d) - %s (%s)\n",sql,mysql_errno(dbc),mysql_error(dbc),mysql_sqlstate(dbc)); return 0; } else //it could have been some insert/update/delete { //this is successful query } } moreresult=mysql_next_result(dbc); if(moreresult > 0 && showresults > 0) { printf("mysql_next_result returned %d, mysql error %s, (%d) (%s)\n",moreresult,mysql_error(dbc),mysql_errno(dbc),mysql_sqlstate(dbc)); return 0; } } while (0==moreresult); return 1; } char* alocmem(size_t num) { char *r=(char*)calloc(num,1); if(NULL == r) { printf("cannot calloc %I64u bytes of memory\n",num); exit(1); } return r; } int write_string(char *buf,const size_t minlen,const size_t maxlen) { if(!buf)return 0; if(maxlen==0 ){buf[0]=0;return 0;} size_t lengt=minlen + (maxlen<=minlen?0:lrand48() % (maxlen-minlen)); int start_lengt = lrand48()%(DATASIZE - lengt - 1); if(lengt<0) lengt=0; if(start_lengt<0) start_lengt=0; memcpy(buf,databucket+start_lengt,lengt); buf[lengt]=0; return lengt; } int ps_func_0000(MYSQL *db) { char *query="select * from `table0000` limit 1"; MYSQL_STMT *stmt=NULL; unsigned int val=0; int i=0; int error=0; unsigned int repeat_count=0; MYSQL_BIND bind_result[7]; unsigned long length_result[7]; my_bool is_null_result[7]; my_bool error_result[7]; memset(bind_result, 0, sizeof(bind_result)); stmt= mysql_stmt_init(db); if (NULL == stmt) { printf("[ps_func_0000] mysql_stmt_init failed: %s (%d) (%s)\n",mysql_error(db),mysql_errno(db),mysql_sqlstate(db)); error=1; goto end; } if(mysql_stmt_prepare(stmt,query,(unsigned long)strlen(query))) { printf("[ps_func_0000] mysql_stmt_prepare failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } val=1; if(mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void *)&val)) { printf("[ps_func_0000] mysql_stmt_attr_set: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } val=CURSOR_TYPE_READ_ONLY; if(mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void *)&val)) { printf("[ps_func_0000] mysql_stmt_attr_set: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } val=5000; if(mysql_stmt_attr_set(stmt, STMT_ATTR_PREFETCH_ROWS, (void *)&val)) { printf("[ps_func_0000] mysql_stmt_attr_set: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } bind_result[0].buffer_type=MYSQL_TYPE_FLOAT; bind_result[0].buffer=alocmem(4); bind_result[0].buffer_length=4; bind_result[0].length=&length_result[0]; bind_result[0].is_null=&is_null_result[0]; bind_result[0].error=&error_result[0]; bind_result[1].buffer_type=MYSQL_TYPE_STRING; bind_result[1].buffer=alocmem(246); bind_result[1].buffer_length=246; bind_result[1].length=&length_result[1]; bind_result[1].is_null=&is_null_result[1]; bind_result[1].error=&error_result[1]; bind_result[2].buffer_type=MYSQL_TYPE_TINY; bind_result[2].buffer=alocmem(1); bind_result[2].buffer_length=1; bind_result[2].length=&length_result[2]; bind_result[2].is_null=&is_null_result[2]; bind_result[2].error=&error_result[2]; bind_result[3].buffer_type=MYSQL_TYPE_BLOB; bind_result[3].buffer=alocmem(10240); bind_result[3].buffer_length=10240; bind_result[3].length=&length_result[3]; bind_result[3].is_null=&is_null_result[3]; bind_result[3].error=&error_result[3]; bind_result[4].buffer_type=MYSQL_TYPE_YEAR; bind_result[4].buffer=alocmem(4); bind_result[4].buffer_length=4; bind_result[4].length=&length_result[4]; bind_result[4].is_null=&is_null_result[4]; bind_result[4].error=&error_result[4]; bind_result[5].buffer_type=MYSQL_TYPE_STRING; bind_result[5].buffer=alocmem(203); bind_result[5].buffer_length=203; bind_result[5].length=&length_result[5]; bind_result[5].is_null=&is_null_result[5]; bind_result[5].error=&error_result[5]; bind_result[6].buffer_type=MYSQL_TYPE_LONG; bind_result[6].buffer=alocmem(4); bind_result[6].buffer_length=4; bind_result[6].length=&length_result[6]; bind_result[6].is_null=&is_null_result[6]; bind_result[6].error=&error_result[6]; repeat_count=2; for(i=0;i<repeat_count;i++) { if(mysql_stmt_execute(stmt)) { printf("[ps_func_0000] mysql_stmt_execute failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } num_queries++; if(mysql_stmt_bind_result(stmt,bind_result)) { printf("[ps_func_0000] mysql_stmt_bind_result failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } if(mysql_stmt_store_result(stmt)) { printf("[ps_func_0000] mysql_stmt_store_result failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } while (!mysql_stmt_fetch(stmt)) { } } end: if(NULL != stmt && mysql_stmt_close(stmt)) { printf("[ps_func_0000] mysql_stmt_close failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; } if(NULL!=bind_result[0].buffer) free(bind_result[0].buffer); if(NULL!=bind_result[1].buffer) free(bind_result[1].buffer); if(NULL!=bind_result[2].buffer) free(bind_result[2].buffer); if(NULL!=bind_result[3].buffer) free(bind_result[3].buffer); if(NULL!=bind_result[4].buffer) free(bind_result[4].buffer); if(NULL!=bind_result[5].buffer) free(bind_result[5].buffer); if(NULL!=bind_result[6].buffer) free(bind_result[6].buffer); if(1==error) goto err; return 1; err: return 0; } int ps_func_0001(MYSQL *db) { char *query="select * from `table0001` limit 1"; MYSQL_STMT *stmt=NULL; unsigned int val=0; int i=0; int error=0; unsigned int repeat_count=0; MYSQL_BIND bind_result[64]; unsigned long length_result[64]; my_bool is_null_result[64]; my_bool error_result[64]; memset(bind_result, 0, sizeof(bind_result)); stmt= mysql_stmt_init(db); if (NULL == stmt) { printf("[ps_func_0001] mysql_stmt_init failed: %s (%d) (%s)\n",mysql_error(db),mysql_errno(db),mysql_sqlstate(db)); error=1; goto end; } if(mysql_stmt_prepare(stmt,query,(unsigned long)strlen(query))) { printf("[ps_func_0001] mysql_stmt_prepare failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } val=1; if(mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void *)&val)) { printf("[ps_func_0001] mysql_stmt_attr_set: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } val=CURSOR_TYPE_READ_ONLY; if(mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void *)&val)) { printf("[ps_func_0001] mysql_stmt_attr_set: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } val=5000; if(mysql_stmt_attr_set(stmt, STMT_ATTR_PREFETCH_ROWS, (void *)&val)) { printf("[ps_func_0001] mysql_stmt_attr_set: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } bind_result[0].buffer_type=MYSQL_TYPE_TINY; bind_result[0].buffer=alocmem(1); bind_result[0].buffer_length=1; bind_result[0].length=&length_result[0]; bind_result[0].is_null=&is_null_result[0]; bind_result[0].error=&error_result[0]; bind_result[1].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[1].buffer=alocmem(8); bind_result[1].buffer_length=8; bind_result[1].length=&length_result[1]; bind_result[1].is_null=&is_null_result[1]; bind_result[1].error=&error_result[1]; bind_result[2].buffer_type=MYSQL_TYPE_VAR_STRING; bind_result[2].buffer=alocmem(195); bind_result[2].buffer_length=195; bind_result[2].length=&length_result[2]; bind_result[2].is_null=&is_null_result[2]; bind_result[2].error=&error_result[2]; bind_result[3].buffer_type=MYSQL_TYPE_YEAR; bind_result[3].buffer=alocmem(4); bind_result[3].buffer_length=4; bind_result[3].length=&length_result[3]; bind_result[3].is_null=&is_null_result[3]; bind_result[3].error=&error_result[3]; bind_result[4].buffer_type=MYSQL_TYPE_INT24; bind_result[4].buffer=alocmem(4); bind_result[4].buffer_length=4; bind_result[4].length=&length_result[4]; bind_result[4].is_null=&is_null_result[4]; bind_result[4].error=&error_result[4]; bind_result[5].buffer_type=MYSQL_TYPE_BLOB; bind_result[5].buffer=alocmem(10240); bind_result[5].buffer_length=10240; bind_result[5].length=&length_result[5]; bind_result[5].is_null=&is_null_result[5]; bind_result[5].error=&error_result[5]; bind_result[6].buffer_type=MYSQL_TYPE_BLOB; bind_result[6].buffer=alocmem(10240); bind_result[6].buffer_length=10240; bind_result[6].length=&length_result[6]; bind_result[6].is_null=&is_null_result[6]; bind_result[6].error=&error_result[6]; bind_result[7].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[7].buffer=alocmem(8); bind_result[7].buffer_length=8; bind_result[7].length=&length_result[7]; bind_result[7].is_null=&is_null_result[7]; bind_result[7].error=&error_result[7]; bind_result[8].buffer_type=MYSQL_TYPE_TINY; bind_result[8].buffer=alocmem(1); bind_result[8].buffer_length=1; bind_result[8].length=&length_result[8]; bind_result[8].is_null=&is_null_result[8]; bind_result[8].error=&error_result[8]; bind_result[9].buffer_type=MYSQL_TYPE_DATE; bind_result[9].buffer=alocmem(36); bind_result[9].buffer_length=36; bind_result[9].length=&length_result[9]; bind_result[9].is_null=&is_null_result[9]; bind_result[9].error=&error_result[9]; bind_result[10].buffer_type=MYSQL_TYPE_VAR_STRING; bind_result[10].buffer=alocmem(28); bind_result[10].buffer_length=28; bind_result[10].length=&length_result[10]; bind_result[10].is_null=&is_null_result[10]; bind_result[10].error=&error_result[10]; bind_result[11].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[11].buffer=alocmem(8); bind_result[11].buffer_length=8; bind_result[11].length=&length_result[11]; bind_result[11].is_null=&is_null_result[11]; bind_result[11].error=&error_result[11]; bind_result[12].buffer_type=MYSQL_TYPE_DATETIME; bind_result[12].buffer=alocmem(36); bind_result[12].buffer_length=36; bind_result[12].length=&length_result[12]; bind_result[12].is_null=&is_null_result[12]; bind_result[12].error=&error_result[12]; bind_result[13].buffer_type=MYSQL_TYPE_DATETIME; bind_result[13].buffer=alocmem(36); bind_result[13].buffer_length=36; bind_result[13].length=&length_result[13]; bind_result[13].is_null=&is_null_result[13]; bind_result[13].error=&error_result[13]; bind_result[14].buffer_type=MYSQL_TYPE_TIME; bind_result[14].buffer=alocmem(36); bind_result[14].buffer_length=36; bind_result[14].length=&length_result[14]; bind_result[14].is_null=&is_null_result[14]; bind_result[14].error=&error_result[14]; bind_result[15].buffer_type=MYSQL_TYPE_DATETIME; bind_result[15].buffer=alocmem(36); bind_result[15].buffer_length=36; bind_result[15].length=&length_result[15]; bind_result[15].is_null=&is_null_result[15]; bind_result[15].error=&error_result[15]; bind_result[16].buffer_type=MYSQL_TYPE_TIME; bind_result[16].buffer=alocmem(36); bind_result[16].buffer_length=36; bind_result[16].length=&length_result[16]; bind_result[16].is_null=&is_null_result[16]; bind_result[16].error=&error_result[16]; bind_result[17].buffer_type=MYSQL_TYPE_BLOB; bind_result[17].buffer=alocmem(10240); bind_result[17].buffer_length=10240; bind_result[17].length=&length_result[17]; bind_result[17].is_null=&is_null_result[17]; bind_result[17].error=&error_result[17]; bind_result[18].buffer_type=MYSQL_TYPE_DATETIME; bind_result[18].buffer=alocmem(36); bind_result[18].buffer_length=36; bind_result[18].length=&length_result[18]; bind_result[18].is_null=&is_null_result[18]; bind_result[18].error=&error_result[18]; bind_result[19].buffer_type=MYSQL_TYPE_BLOB; bind_result[19].buffer=alocmem(10240); bind_result[19].buffer_length=10240; bind_result[19].length=&length_result[19]; bind_result[19].is_null=&is_null_result[19]; bind_result[19].error=&error_result[19]; bind_result[20].buffer_type=MYSQL_TYPE_BLOB; bind_result[20].buffer=alocmem(10240); bind_result[20].buffer_length=10240; bind_result[20].length=&length_result[20]; bind_result[20].is_null=&is_null_result[20]; bind_result[20].error=&error_result[20]; bind_result[21].buffer_type=MYSQL_TYPE_BLOB; bind_result[21].buffer=alocmem(10240); bind_result[21].buffer_length=10240; bind_result[21].length=&length_result[21]; bind_result[21].is_null=&is_null_result[21]; bind_result[21].error=&error_result[21]; bind_result[22].buffer_type=MYSQL_TYPE_BLOB; bind_result[22].buffer=alocmem(10240); bind_result[22].buffer_length=10240; bind_result[22].length=&length_result[22]; bind_result[22].is_null=&is_null_result[22]; bind_result[22].error=&error_result[22]; bind_result[23].buffer_type=MYSQL_TYPE_BLOB; bind_result[23].buffer=alocmem(255); bind_result[23].buffer_length=255; bind_result[23].length=&length_result[23]; bind_result[23].is_null=&is_null_result[23]; bind_result[23].error=&error_result[23]; bind_result[24].buffer_type=MYSQL_TYPE_TINY; bind_result[24].buffer=alocmem(1); bind_result[24].buffer_length=1; bind_result[24].length=&length_result[24]; bind_result[24].is_null=&is_null_result[24]; bind_result[24].error=&error_result[24]; bind_result[25].buffer_type=MYSQL_TYPE_BLOB; bind_result[25].buffer=alocmem(10240); bind_result[25].buffer_length=10240; bind_result[25].length=&length_result[25]; bind_result[25].is_null=&is_null_result[25]; bind_result[25].error=&error_result[25]; bind_result[26].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[26].buffer=alocmem(8); bind_result[26].buffer_length=8; bind_result[26].length=&length_result[26]; bind_result[26].is_null=&is_null_result[26]; bind_result[26].error=&error_result[26]; bind_result[27].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[27].buffer=alocmem(8); bind_result[27].buffer_length=8; bind_result[27].length=&length_result[27]; bind_result[27].is_null=&is_null_result[27]; bind_result[27].error=&error_result[27]; bind_result[28].buffer_type=MYSQL_TYPE_VAR_STRING; bind_result[28].buffer=alocmem(20); bind_result[28].buffer_length=20; bind_result[28].length=&length_result[28]; bind_result[28].is_null=&is_null_result[28]; bind_result[28].error=&error_result[28]; bind_result[29].buffer_type=MYSQL_TYPE_BLOB; bind_result[29].buffer=alocmem(10240); bind_result[29].buffer_length=10240; bind_result[29].length=&length_result[29]; bind_result[29].is_null=&is_null_result[29]; bind_result[29].error=&error_result[29]; bind_result[30].buffer_type=MYSQL_TYPE_BLOB; bind_result[30].buffer=alocmem(10240); bind_result[30].buffer_length=10240; bind_result[30].length=&length_result[30]; bind_result[30].is_null=&is_null_result[30]; bind_result[30].error=&error_result[30]; bind_result[31].buffer_type=MYSQL_TYPE_STRING; bind_result[31].buffer=alocmem(146); bind_result[31].buffer_length=146; bind_result[31].length=&length_result[31]; bind_result[31].is_null=&is_null_result[31]; bind_result[31].error=&error_result[31]; bind_result[32].buffer_type=MYSQL_TYPE_FLOAT; bind_result[32].buffer=alocmem(4); bind_result[32].buffer_length=4; bind_result[32].length=&length_result[32]; bind_result[32].is_null=&is_null_result[32]; bind_result[32].error=&error_result[32]; bind_result[33].buffer_type=MYSQL_TYPE_DATE; bind_result[33].buffer=alocmem(36); bind_result[33].buffer_length=36; bind_result[33].length=&length_result[33]; bind_result[33].is_null=&is_null_result[33]; bind_result[33].error=&error_result[33]; bind_result[34].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[34].buffer=alocmem(8); bind_result[34].buffer_length=8; bind_result[34].length=&length_result[34]; bind_result[34].is_null=&is_null_result[34]; bind_result[34].error=&error_result[34]; bind_result[35].buffer_type=MYSQL_TYPE_BLOB; bind_result[35].buffer=alocmem(10240); bind_result[35].buffer_length=10240; bind_result[35].length=&length_result[35]; bind_result[35].is_null=&is_null_result[35]; bind_result[35].error=&error_result[35]; bind_result[36].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[36].buffer=alocmem(8); bind_result[36].buffer_length=8; bind_result[36].length=&length_result[36]; bind_result[36].is_null=&is_null_result[36]; bind_result[36].error=&error_result[36]; bind_result[37].buffer_type=MYSQL_TYPE_NEWDECIMAL; bind_result[37].buffer=alocmem(11); bind_result[37].buffer_length=11; bind_result[37].length=&length_result[37]; bind_result[37].is_null=&is_null_result[37]; bind_result[37].error=&error_result[37]; bind_result[38].buffer_type=MYSQL_TYPE_NEWDECIMAL; bind_result[38].buffer=alocmem(11); bind_result[38].buffer_length=11; bind_result[38].length=&length_result[38]; bind_result[38].is_null=&is_null_result[38]; bind_result[38].error=&error_result[38]; bind_result[39].buffer_type=MYSQL_TYPE_TINY; bind_result[39].buffer=alocmem(1); bind_result[39].buffer_length=1; bind_result[39].length=&length_result[39]; bind_result[39].is_null=&is_null_result[39]; bind_result[39].error=&error_result[39]; bind_result[40].buffer_type=MYSQL_TYPE_INT24; bind_result[40].buffer=alocmem(4); bind_result[40].buffer_length=4; bind_result[40].length=&length_result[40]; bind_result[40].is_null=&is_null_result[40]; bind_result[40].error=&error_result[40]; bind_result[41].buffer_type=MYSQL_TYPE_NEWDECIMAL; bind_result[41].buffer=alocmem(11); bind_result[41].buffer_length=11; bind_result[41].length=&length_result[41]; bind_result[41].is_null=&is_null_result[41]; bind_result[41].error=&error_result[41]; bind_result[42].buffer_type=MYSQL_TYPE_YEAR; bind_result[42].buffer=alocmem(4); bind_result[42].buffer_length=4; bind_result[42].length=&length_result[42]; bind_result[42].is_null=&is_null_result[42]; bind_result[42].error=&error_result[42]; bind_result[43].buffer_type=MYSQL_TYPE_VAR_STRING; bind_result[43].buffer=alocmem(174); bind_result[43].buffer_length=174; bind_result[43].length=&length_result[43]; bind_result[43].is_null=&is_null_result[43]; bind_result[43].error=&error_result[43]; bind_result[44].buffer_type=MYSQL_TYPE_LONG; bind_result[44].buffer=alocmem(4); bind_result[44].buffer_length=4; bind_result[44].length=&length_result[44]; bind_result[44].is_null=&is_null_result[44]; bind_result[44].error=&error_result[44]; bind_result[45].buffer_type=MYSQL_TYPE_BLOB; bind_result[45].buffer=alocmem(10240); bind_result[45].buffer_length=10240; bind_result[45].length=&length_result[45]; bind_result[45].is_null=&is_null_result[45]; bind_result[45].error=&error_result[45]; bind_result[46].buffer_type=MYSQL_TYPE_DATETIME; bind_result[46].buffer=alocmem(36); bind_result[46].buffer_length=36; bind_result[46].length=&length_result[46]; bind_result[46].is_null=&is_null_result[46]; bind_result[46].error=&error_result[46]; bind_result[47].buffer_type=MYSQL_TYPE_LONGLONG; bind_result[47].buffer=alocmem(8); bind_result[47].buffer_length=8; bind_result[47].length=&length_result[47]; bind_result[47].is_null=&is_null_result[47]; bind_result[47].error=&error_result[47]; bind_result[48].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[48].buffer=alocmem(8); bind_result[48].buffer_length=8; bind_result[48].length=&length_result[48]; bind_result[48].is_null=&is_null_result[48]; bind_result[48].error=&error_result[48]; bind_result[49].buffer_type=MYSQL_TYPE_LONGLONG; bind_result[49].buffer=alocmem(8); bind_result[49].buffer_length=8; bind_result[49].length=&length_result[49]; bind_result[49].is_null=&is_null_result[49]; bind_result[49].error=&error_result[49]; bind_result[50].buffer_type=MYSQL_TYPE_BLOB; bind_result[50].buffer=alocmem(255); bind_result[50].buffer_length=255; bind_result[50].length=&length_result[50]; bind_result[50].is_null=&is_null_result[50]; bind_result[50].error=&error_result[50]; bind_result[51].buffer_type=MYSQL_TYPE_NEWDECIMAL; bind_result[51].buffer=alocmem(11); bind_result[51].buffer_length=11; bind_result[51].length=&length_result[51]; bind_result[51].is_null=&is_null_result[51]; bind_result[51].error=&error_result[51]; bind_result[52].buffer_type=MYSQL_TYPE_NEWDECIMAL; bind_result[52].buffer=alocmem(11); bind_result[52].buffer_length=11; bind_result[52].length=&length_result[52]; bind_result[52].is_null=&is_null_result[52]; bind_result[52].error=&error_result[52]; bind_result[53].buffer_type=MYSQL_TYPE_TIMESTAMP; bind_result[53].buffer=alocmem(36); bind_result[53].buffer_length=36; bind_result[53].length=&length_result[53]; bind_result[53].is_null=&is_null_result[53]; bind_result[53].error=&error_result[53]; bind_result[54].buffer_type=MYSQL_TYPE_BLOB; bind_result[54].buffer=alocmem(10240); bind_result[54].buffer_length=10240; bind_result[54].length=&length_result[54]; bind_result[54].is_null=&is_null_result[54]; bind_result[54].error=&error_result[54]; bind_result[55].buffer_type=MYSQL_TYPE_LONG; bind_result[55].buffer=alocmem(4); bind_result[55].buffer_length=4; bind_result[55].length=&length_result[55]; bind_result[55].is_null=&is_null_result[55]; bind_result[55].error=&error_result[55]; bind_result[56].buffer_type=MYSQL_TYPE_TINY; bind_result[56].buffer=alocmem(1); bind_result[56].buffer_length=1; bind_result[56].length=&length_result[56]; bind_result[56].is_null=&is_null_result[56]; bind_result[56].error=&error_result[56]; bind_result[57].buffer_type=MYSQL_TYPE_BLOB; bind_result[57].buffer=alocmem(10240); bind_result[57].buffer_length=10240; bind_result[57].length=&length_result[57]; bind_result[57].is_null=&is_null_result[57]; bind_result[57].error=&error_result[57]; bind_result[58].buffer_type=MYSQL_TYPE_DATETIME; bind_result[58].buffer=alocmem(36); bind_result[58].buffer_length=36; bind_result[58].length=&length_result[58]; bind_result[58].is_null=&is_null_result[58]; bind_result[58].error=&error_result[58]; bind_result[59].buffer_type=MYSQL_TYPE_DATE; bind_result[59].buffer=alocmem(36); bind_result[59].buffer_length=36; bind_result[59].length=&length_result[59]; bind_result[59].is_null=&is_null_result[59]; bind_result[59].error=&error_result[59]; bind_result[60].buffer_type=MYSQL_TYPE_STRING; bind_result[60].buffer=alocmem(13); bind_result[60].buffer_length=13; bind_result[60].length=&length_result[60]; bind_result[60].is_null=&is_null_result[60]; bind_result[60].error=&error_result[60]; bind_result[61].buffer_type=MYSQL_TYPE_BLOB; bind_result[61].buffer=alocmem(10240); bind_result[61].buffer_length=10240; bind_result[61].length=&length_result[61]; bind_result[61].is_null=&is_null_result[61]; bind_result[61].error=&error_result[61]; bind_result[62].buffer_type=MYSQL_TYPE_BLOB; bind_result[62].buffer=alocmem(10240); bind_result[62].buffer_length=10240; bind_result[62].length=&length_result[62]; bind_result[62].is_null=&is_null_result[62]; bind_result[62].error=&error_result[62]; bind_result[63].buffer_type=MYSQL_TYPE_LONG; bind_result[63].buffer=alocmem(4); bind_result[63].buffer_length=4; bind_result[63].length=&length_result[63]; bind_result[63].is_null=&is_null_result[63]; bind_result[63].error=&error_result[63]; repeat_count=2; for(i=0;i<repeat_count;i++) { if(mysql_stmt_execute(stmt)) { printf("[ps_func_0001] mysql_stmt_execute failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } num_queries++; if(mysql_stmt_bind_result(stmt,bind_result)) { printf("[ps_func_0001] mysql_stmt_bind_result failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } if(mysql_stmt_store_result(stmt)) { printf("[ps_func_0001] mysql_stmt_store_result failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } while (!mysql_stmt_fetch(stmt)) { } } end: if(NULL != stmt && mysql_stmt_close(stmt)) { printf("[ps_func_0001] mysql_stmt_close failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; } if(NULL!=bind_result[0].buffer) free(bind_result[0].buffer); if(NULL!=bind_result[1].buffer) free(bind_result[1].buffer); if(NULL!=bind_result[2].buffer) free(bind_result[2].buffer); if(NULL!=bind_result[3].buffer) free(bind_result[3].buffer); if(NULL!=bind_result[4].buffer) free(bind_result[4].buffer); if(NULL!=bind_result[5].buffer) free(bind_result[5].buffer); if(NULL!=bind_result[6].buffer) free(bind_result[6].buffer); if(NULL!=bind_result[7].buffer) free(bind_result[7].buffer); if(NULL!=bind_result[8].buffer) free(bind_result[8].buffer); if(NULL!=bind_result[9].buffer) free(bind_result[9].buffer); if(NULL!=bind_result[10].buffer) free(bind_result[10].buffer); if(NULL!=bind_result[11].buffer) free(bind_result[11].buffer); if(NULL!=bind_result[12].buffer) free(bind_result[12].buffer); if(NULL!=bind_result[13].buffer) free(bind_result[13].buffer); if(NULL!=bind_result[14].buffer) free(bind_result[14].buffer); if(NULL!=bind_result[15].buffer) free(bind_result[15].buffer); if(NULL!=bind_result[16].buffer) free(bind_result[16].buffer); if(NULL!=bind_result[17].buffer) free(bind_result[17].buffer); if(NULL!=bind_result[18].buffer) free(bind_result[18].buffer); if(NULL!=bind_result[19].buffer) free(bind_result[19].buffer); if(NULL!=bind_result[20].buffer) free(bind_result[20].buffer); if(NULL!=bind_result[21].buffer) free(bind_result[21].buffer); if(NULL!=bind_result[22].buffer) free(bind_result[22].buffer); if(NULL!=bind_result[23].buffer) free(bind_result[23].buffer); if(NULL!=bind_result[24].buffer) free(bind_result[24].buffer); if(NULL!=bind_result[25].buffer) free(bind_result[25].buffer); if(NULL!=bind_result[26].buffer) free(bind_result[26].buffer); if(NULL!=bind_result[27].buffer) free(bind_result[27].buffer); if(NULL!=bind_result[28].buffer) free(bind_result[28].buffer); if(NULL!=bind_result[29].buffer) free(bind_result[29].buffer); if(NULL!=bind_result[30].buffer) free(bind_result[30].buffer); if(NULL!=bind_result[31].buffer) free(bind_result[31].buffer); if(NULL!=bind_result[32].buffer) free(bind_result[32].buffer); if(NULL!=bind_result[33].buffer) free(bind_result[33].buffer); if(NULL!=bind_result[34].buffer) free(bind_result[34].buffer); if(NULL!=bind_result[35].buffer) free(bind_result[35].buffer); if(NULL!=bind_result[36].buffer) free(bind_result[36].buffer); if(NULL!=bind_result[37].buffer) free(bind_result[37].buffer); if(NULL!=bind_result[38].buffer) free(bind_result[38].buffer); if(NULL!=bind_result[39].buffer) free(bind_result[39].buffer); if(NULL!=bind_result[40].buffer) free(bind_result[40].buffer); if(NULL!=bind_result[41].buffer) free(bind_result[41].buffer); if(NULL!=bind_result[42].buffer) free(bind_result[42].buffer); if(NULL!=bind_result[43].buffer) free(bind_result[43].buffer); if(NULL!=bind_result[44].buffer) free(bind_result[44].buffer); if(NULL!=bind_result[45].buffer) free(bind_result[45].buffer); if(NULL!=bind_result[46].buffer) free(bind_result[46].buffer); if(NULL!=bind_result[47].buffer) free(bind_result[47].buffer); if(NULL!=bind_result[48].buffer) free(bind_result[48].buffer); if(NULL!=bind_result[49].buffer) free(bind_result[49].buffer); if(NULL!=bind_result[50].buffer) free(bind_result[50].buffer); if(NULL!=bind_result[51].buffer) free(bind_result[51].buffer); if(NULL!=bind_result[52].buffer) free(bind_result[52].buffer); if(NULL!=bind_result[53].buffer) free(bind_result[53].buffer); if(NULL!=bind_result[54].buffer) free(bind_result[54].buffer); if(NULL!=bind_result[55].buffer) free(bind_result[55].buffer); if(NULL!=bind_result[56].buffer) free(bind_result[56].buffer); if(NULL!=bind_result[57].buffer) free(bind_result[57].buffer); if(NULL!=bind_result[58].buffer) free(bind_result[58].buffer); if(NULL!=bind_result[59].buffer) free(bind_result[59].buffer); if(NULL!=bind_result[60].buffer) free(bind_result[60].buffer); if(NULL!=bind_result[61].buffer) free(bind_result[61].buffer); if(NULL!=bind_result[62].buffer) free(bind_result[62].buffer); if(NULL!=bind_result[63].buffer) free(bind_result[63].buffer); if(1==error) goto err; return 1; err: return 0; } int ps_func_0002(MYSQL *db) { char *query="select * from `table0002` limit 1"; MYSQL_STMT *stmt=NULL; unsigned int val=0; int i=0; int error=0; unsigned int repeat_count=0; MYSQL_BIND bind_result[78]; unsigned long length_result[78]; my_bool is_null_result[78]; my_bool error_result[78]; memset(bind_result, 0, sizeof(bind_result)); stmt= mysql_stmt_init(db); if (NULL == stmt) { printf("[ps_func_0002] mysql_stmt_init failed: %s (%d) (%s)\n",mysql_error(db),mysql_errno(db),mysql_sqlstate(db)); error=1; goto end; } if(mysql_stmt_prepare(stmt,query,(unsigned long)strlen(query))) { printf("[ps_func_0002] mysql_stmt_prepare failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } val=1; if(mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void *)&val)) { printf("[ps_func_0002] mysql_stmt_attr_set: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } val=CURSOR_TYPE_READ_ONLY; if(mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void *)&val)) { printf("[ps_func_0002] mysql_stmt_attr_set: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } val=5000; if(mysql_stmt_attr_set(stmt, STMT_ATTR_PREFETCH_ROWS, (void *)&val)) { printf("[ps_func_0002] mysql_stmt_attr_set: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } bind_result[0].buffer_type=MYSQL_TYPE_VAR_STRING; bind_result[0].buffer=alocmem(37); bind_result[0].buffer_length=37; bind_result[0].length=&length_result[0]; bind_result[0].is_null=&is_null_result[0]; bind_result[0].error=&error_result[0]; bind_result[1].buffer_type=MYSQL_TYPE_BLOB; bind_result[1].buffer=alocmem(10240); bind_result[1].buffer_length=10240; bind_result[1].length=&length_result[1]; bind_result[1].is_null=&is_null_result[1]; bind_result[1].error=&error_result[1]; bind_result[2].buffer_type=MYSQL_TYPE_TINY; bind_result[2].buffer=alocmem(1); bind_result[2].buffer_length=1; bind_result[2].length=&length_result[2]; bind_result[2].is_null=&is_null_result[2]; bind_result[2].error=&error_result[2]; bind_result[3].buffer_type=MYSQL_TYPE_LONGLONG; bind_result[3].buffer=alocmem(8); bind_result[3].buffer_length=8; bind_result[3].length=&length_result[3]; bind_result[3].is_null=&is_null_result[3]; bind_result[3].error=&error_result[3]; bind_result[4].buffer_type=MYSQL_TYPE_BLOB; bind_result[4].buffer=alocmem(10240); bind_result[4].buffer_length=10240; bind_result[4].length=&length_result[4]; bind_result[4].is_null=&is_null_result[4]; bind_result[4].error=&error_result[4]; bind_result[5].buffer_type=MYSQL_TYPE_TINY; bind_result[5].buffer=alocmem(1); bind_result[5].buffer_length=1; bind_result[5].length=&length_result[5]; bind_result[5].is_null=&is_null_result[5]; bind_result[5].error=&error_result[5]; bind_result[6].buffer_type=MYSQL_TYPE_LONG; bind_result[6].buffer=alocmem(4); bind_result[6].buffer_length=4; bind_result[6].length=&length_result[6]; bind_result[6].is_null=&is_null_result[6]; bind_result[6].error=&error_result[6]; bind_result[7].buffer_type=MYSQL_TYPE_TIME; bind_result[7].buffer=alocmem(36); bind_result[7].buffer_length=36; bind_result[7].length=&length_result[7]; bind_result[7].is_null=&is_null_result[7]; bind_result[7].error=&error_result[7]; bind_result[8].buffer_type=MYSQL_TYPE_INT24; bind_result[8].buffer=alocmem(4); bind_result[8].buffer_length=4; bind_result[8].length=&length_result[8]; bind_result[8].is_null=&is_null_result[8]; bind_result[8].error=&error_result[8]; bind_result[9].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[9].buffer=alocmem(8); bind_result[9].buffer_length=8; bind_result[9].length=&length_result[9]; bind_result[9].is_null=&is_null_result[9]; bind_result[9].error=&error_result[9]; bind_result[10].buffer_type=MYSQL_TYPE_TIME; bind_result[10].buffer=alocmem(36); bind_result[10].buffer_length=36; bind_result[10].length=&length_result[10]; bind_result[10].is_null=&is_null_result[10]; bind_result[10].error=&error_result[10]; bind_result[11].buffer_type=MYSQL_TYPE_LONGLONG; bind_result[11].buffer=alocmem(8); bind_result[11].buffer_length=8; bind_result[11].length=&length_result[11]; bind_result[11].is_null=&is_null_result[11]; bind_result[11].error=&error_result[11]; bind_result[12].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[12].buffer=alocmem(8); bind_result[12].buffer_length=8; bind_result[12].length=&length_result[12]; bind_result[12].is_null=&is_null_result[12]; bind_result[12].error=&error_result[12]; bind_result[13].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[13].buffer=alocmem(8); bind_result[13].buffer_length=8; bind_result[13].length=&length_result[13]; bind_result[13].is_null=&is_null_result[13]; bind_result[13].error=&error_result[13]; bind_result[14].buffer_type=MYSQL_TYPE_STRING; bind_result[14].buffer=alocmem(64); bind_result[14].buffer_length=64; bind_result[14].length=&length_result[14]; bind_result[14].is_null=&is_null_result[14]; bind_result[14].error=&error_result[14]; bind_result[15].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[15].buffer=alocmem(8); bind_result[15].buffer_length=8; bind_result[15].length=&length_result[15]; bind_result[15].is_null=&is_null_result[15]; bind_result[15].error=&error_result[15]; bind_result[16].buffer_type=MYSQL_TYPE_TIMESTAMP; bind_result[16].buffer=alocmem(36); bind_result[16].buffer_length=36; bind_result[16].length=&length_result[16]; bind_result[16].is_null=&is_null_result[16]; bind_result[16].error=&error_result[16]; bind_result[17].buffer_type=MYSQL_TYPE_LONG; bind_result[17].buffer=alocmem(4); bind_result[17].buffer_length=4; bind_result[17].length=&length_result[17]; bind_result[17].is_null=&is_null_result[17]; bind_result[17].error=&error_result[17]; bind_result[18].buffer_type=MYSQL_TYPE_TINY; bind_result[18].buffer=alocmem(1); bind_result[18].buffer_length=1; bind_result[18].length=&length_result[18]; bind_result[18].is_null=&is_null_result[18]; bind_result[18].error=&error_result[18]; bind_result[19].buffer_type=MYSQL_TYPE_BLOB; bind_result[19].buffer=alocmem(10240); bind_result[19].buffer_length=10240; bind_result[19].length=&length_result[19]; bind_result[19].is_null=&is_null_result[19]; bind_result[19].error=&error_result[19]; bind_result[20].buffer_type=MYSQL_TYPE_STRING; bind_result[20].buffer=alocmem(145); bind_result[20].buffer_length=145; bind_result[20].length=&length_result[20]; bind_result[20].is_null=&is_null_result[20]; bind_result[20].error=&error_result[20]; bind_result[21].buffer_type=MYSQL_TYPE_BLOB; bind_result[21].buffer=alocmem(255); bind_result[21].buffer_length=255; bind_result[21].length=&length_result[21]; bind_result[21].is_null=&is_null_result[21]; bind_result[21].error=&error_result[21]; bind_result[22].buffer_type=MYSQL_TYPE_LONGLONG; bind_result[22].buffer=alocmem(8); bind_result[22].buffer_length=8; bind_result[22].length=&length_result[22]; bind_result[22].is_null=&is_null_result[22]; bind_result[22].error=&error_result[22]; bind_result[23].buffer_type=MYSQL_TYPE_NEWDECIMAL; bind_result[23].buffer=alocmem(11); bind_result[23].buffer_length=11; bind_result[23].length=&length_result[23]; bind_result[23].is_null=&is_null_result[23]; bind_result[23].error=&error_result[23]; bind_result[24].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[24].buffer=alocmem(8); bind_result[24].buffer_length=8; bind_result[24].length=&length_result[24]; bind_result[24].is_null=&is_null_result[24]; bind_result[24].error=&error_result[24]; bind_result[25].buffer_type=MYSQL_TYPE_STRING; bind_result[25].buffer=alocmem(197); bind_result[25].buffer_length=197; bind_result[25].length=&length_result[25]; bind_result[25].is_null=&is_null_result[25]; bind_result[25].error=&error_result[25]; bind_result[26].buffer_type=MYSQL_TYPE_BLOB; bind_result[26].buffer=alocmem(255); bind_result[26].buffer_length=255; bind_result[26].length=&length_result[26]; bind_result[26].is_null=&is_null_result[26]; bind_result[26].error=&error_result[26]; bind_result[27].buffer_type=MYSQL_TYPE_TINY; bind_result[27].buffer=alocmem(1); bind_result[27].buffer_length=1; bind_result[27].length=&length_result[27]; bind_result[27].is_null=&is_null_result[27]; bind_result[27].error=&error_result[27]; bind_result[28].buffer_type=MYSQL_TYPE_LONG; bind_result[28].buffer=alocmem(4); bind_result[28].buffer_length=4; bind_result[28].length=&length_result[28]; bind_result[28].is_null=&is_null_result[28]; bind_result[28].error=&error_result[28]; bind_result[29].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[29].buffer=alocmem(8); bind_result[29].buffer_length=8; bind_result[29].length=&length_result[29]; bind_result[29].is_null=&is_null_result[29]; bind_result[29].error=&error_result[29]; bind_result[30].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[30].buffer=alocmem(8); bind_result[30].buffer_length=8; bind_result[30].length=&length_result[30]; bind_result[30].is_null=&is_null_result[30]; bind_result[30].error=&error_result[30]; bind_result[31].buffer_type=MYSQL_TYPE_TINY; bind_result[31].buffer=alocmem(1); bind_result[31].buffer_length=1; bind_result[31].length=&length_result[31]; bind_result[31].is_null=&is_null_result[31]; bind_result[31].error=&error_result[31]; bind_result[32].buffer_type=MYSQL_TYPE_TIMESTAMP; bind_result[32].buffer=alocmem(36); bind_result[32].buffer_length=36; bind_result[32].length=&length_result[32]; bind_result[32].is_null=&is_null_result[32]; bind_result[32].error=&error_result[32]; bind_result[33].buffer_type=MYSQL_TYPE_BLOB; bind_result[33].buffer=alocmem(255); bind_result[33].buffer_length=255; bind_result[33].length=&length_result[33]; bind_result[33].is_null=&is_null_result[33]; bind_result[33].error=&error_result[33]; bind_result[34].buffer_type=MYSQL_TYPE_BLOB; bind_result[34].buffer=alocmem(255); bind_result[34].buffer_length=255; bind_result[34].length=&length_result[34]; bind_result[34].is_null=&is_null_result[34]; bind_result[34].error=&error_result[34]; bind_result[35].buffer_type=MYSQL_TYPE_BLOB; bind_result[35].buffer=alocmem(10240); bind_result[35].buffer_length=10240; bind_result[35].length=&length_result[35]; bind_result[35].is_null=&is_null_result[35]; bind_result[35].error=&error_result[35]; bind_result[36].buffer_type=MYSQL_TYPE_YEAR; bind_result[36].buffer=alocmem(4); bind_result[36].buffer_length=4; bind_result[36].length=&length_result[36]; bind_result[36].is_null=&is_null_result[36]; bind_result[36].error=&error_result[36]; bind_result[37].buffer_type=MYSQL_TYPE_TIME; bind_result[37].buffer=alocmem(36); bind_result[37].buffer_length=36; bind_result[37].length=&length_result[37]; bind_result[37].is_null=&is_null_result[37]; bind_result[37].error=&error_result[37]; bind_result[38].buffer_type=MYSQL_TYPE_BLOB; bind_result[38].buffer=alocmem(10240); bind_result[38].buffer_length=10240; bind_result[38].length=&length_result[38]; bind_result[38].is_null=&is_null_result[38]; bind_result[38].error=&error_result[38]; bind_result[39].buffer_type=MYSQL_TYPE_TINY; bind_result[39].buffer=alocmem(1); bind_result[39].buffer_length=1; bind_result[39].length=&length_result[39]; bind_result[39].is_null=&is_null_result[39]; bind_result[39].error=&error_result[39]; bind_result[40].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[40].buffer=alocmem(8); bind_result[40].buffer_length=8; bind_result[40].length=&length_result[40]; bind_result[40].is_null=&is_null_result[40]; bind_result[40].error=&error_result[40]; bind_result[41].buffer_type=MYSQL_TYPE_INT24; bind_result[41].buffer=alocmem(4); bind_result[41].buffer_length=4; bind_result[41].length=&length_result[41]; bind_result[41].is_null=&is_null_result[41]; bind_result[41].error=&error_result[41]; bind_result[42].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[42].buffer=alocmem(8); bind_result[42].buffer_length=8; bind_result[42].length=&length_result[42]; bind_result[42].is_null=&is_null_result[42]; bind_result[42].error=&error_result[42]; bind_result[43].buffer_type=MYSQL_TYPE_BLOB; bind_result[43].buffer=alocmem(10240); bind_result[43].buffer_length=10240; bind_result[43].length=&length_result[43]; bind_result[43].is_null=&is_null_result[43]; bind_result[43].error=&error_result[43]; bind_result[44].buffer_type=MYSQL_TYPE_YEAR; bind_result[44].buffer=alocmem(4); bind_result[44].buffer_length=4; bind_result[44].length=&length_result[44]; bind_result[44].is_null=&is_null_result[44]; bind_result[44].error=&error_result[44]; bind_result[45].buffer_type=MYSQL_TYPE_TIMESTAMP; bind_result[45].buffer=alocmem(36); bind_result[45].buffer_length=36; bind_result[45].length=&length_result[45]; bind_result[45].is_null=&is_null_result[45]; bind_result[45].error=&error_result[45]; bind_result[46].buffer_type=MYSQL_TYPE_TIMESTAMP; bind_result[46].buffer=alocmem(36); bind_result[46].buffer_length=36; bind_result[46].length=&length_result[46]; bind_result[46].is_null=&is_null_result[46]; bind_result[46].error=&error_result[46]; bind_result[47].buffer_type=MYSQL_TYPE_NEWDECIMAL; bind_result[47].buffer=alocmem(11); bind_result[47].buffer_length=11; bind_result[47].length=&length_result[47]; bind_result[47].is_null=&is_null_result[47]; bind_result[47].error=&error_result[47]; bind_result[48].buffer_type=MYSQL_TYPE_BLOB; bind_result[48].buffer=alocmem(255); bind_result[48].buffer_length=255; bind_result[48].length=&length_result[48]; bind_result[48].is_null=&is_null_result[48]; bind_result[48].error=&error_result[48]; bind_result[49].buffer_type=MYSQL_TYPE_DATETIME; bind_result[49].buffer=alocmem(36); bind_result[49].buffer_length=36; bind_result[49].length=&length_result[49]; bind_result[49].is_null=&is_null_result[49]; bind_result[49].error=&error_result[49]; bind_result[50].buffer_type=MYSQL_TYPE_YEAR; bind_result[50].buffer=alocmem(4); bind_result[50].buffer_length=4; bind_result[50].length=&length_result[50]; bind_result[50].is_null=&is_null_result[50]; bind_result[50].error=&error_result[50]; bind_result[51].buffer_type=MYSQL_TYPE_DATE; bind_result[51].buffer=alocmem(36); bind_result[51].buffer_length=36; bind_result[51].length=&length_result[51]; bind_result[51].is_null=&is_null_result[51]; bind_result[51].error=&error_result[51]; bind_result[52].buffer_type=MYSQL_TYPE_TIME; bind_result[52].buffer=alocmem(36); bind_result[52].buffer_length=36; bind_result[52].length=&length_result[52]; bind_result[52].is_null=&is_null_result[52]; bind_result[52].error=&error_result[52]; bind_result[53].buffer_type=MYSQL_TYPE_INT24; bind_result[53].buffer=alocmem(4); bind_result[53].buffer_length=4; bind_result[53].length=&length_result[53]; bind_result[53].is_null=&is_null_result[53]; bind_result[53].error=&error_result[53]; bind_result[54].buffer_type=MYSQL_TYPE_INT24; bind_result[54].buffer=alocmem(4); bind_result[54].buffer_length=4; bind_result[54].length=&length_result[54]; bind_result[54].is_null=&is_null_result[54]; bind_result[54].error=&error_result[54]; bind_result[55].buffer_type=MYSQL_TYPE_INT24; bind_result[55].buffer=alocmem(4); bind_result[55].buffer_length=4; bind_result[55].length=&length_result[55]; bind_result[55].is_null=&is_null_result[55]; bind_result[55].error=&error_result[55]; bind_result[56].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[56].buffer=alocmem(8); bind_result[56].buffer_length=8; bind_result[56].length=&length_result[56]; bind_result[56].is_null=&is_null_result[56]; bind_result[56].error=&error_result[56]; bind_result[57].buffer_type=MYSQL_TYPE_FLOAT; bind_result[57].buffer=alocmem(4); bind_result[57].buffer_length=4; bind_result[57].length=&length_result[57]; bind_result[57].is_null=&is_null_result[57]; bind_result[57].error=&error_result[57]; bind_result[58].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[58].buffer=alocmem(8); bind_result[58].buffer_length=8; bind_result[58].length=&length_result[58]; bind_result[58].is_null=&is_null_result[58]; bind_result[58].error=&error_result[58]; bind_result[59].buffer_type=MYSQL_TYPE_LONG; bind_result[59].buffer=alocmem(4); bind_result[59].buffer_length=4; bind_result[59].length=&length_result[59]; bind_result[59].is_null=&is_null_result[59]; bind_result[59].error=&error_result[59]; bind_result[60].buffer_type=MYSQL_TYPE_BLOB; bind_result[60].buffer=alocmem(10240); bind_result[60].buffer_length=10240; bind_result[60].length=&length_result[60]; bind_result[60].is_null=&is_null_result[60]; bind_result[60].error=&error_result[60]; bind_result[61].buffer_type=MYSQL_TYPE_YEAR; bind_result[61].buffer=alocmem(4); bind_result[61].buffer_length=4; bind_result[61].length=&length_result[61]; bind_result[61].is_null=&is_null_result[61]; bind_result[61].error=&error_result[61]; bind_result[62].buffer_type=MYSQL_TYPE_LONG; bind_result[62].buffer=alocmem(4); bind_result[62].buffer_length=4; bind_result[62].length=&length_result[62]; bind_result[62].is_null=&is_null_result[62]; bind_result[62].error=&error_result[62]; bind_result[63].buffer_type=MYSQL_TYPE_BLOB; bind_result[63].buffer=alocmem(10240); bind_result[63].buffer_length=10240; bind_result[63].length=&length_result[63]; bind_result[63].is_null=&is_null_result[63]; bind_result[63].error=&error_result[63]; bind_result[64].buffer_type=MYSQL_TYPE_YEAR; bind_result[64].buffer=alocmem(4); bind_result[64].buffer_length=4; bind_result[64].length=&length_result[64]; bind_result[64].is_null=&is_null_result[64]; bind_result[64].error=&error_result[64]; bind_result[65].buffer_type=MYSQL_TYPE_BLOB; bind_result[65].buffer=alocmem(255); bind_result[65].buffer_length=255; bind_result[65].length=&length_result[65]; bind_result[65].is_null=&is_null_result[65]; bind_result[65].error=&error_result[65]; bind_result[66].buffer_type=MYSQL_TYPE_LONG; bind_result[66].buffer=alocmem(4); bind_result[66].buffer_length=4; bind_result[66].length=&length_result[66]; bind_result[66].is_null=&is_null_result[66]; bind_result[66].error=&error_result[66]; bind_result[67].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[67].buffer=alocmem(8); bind_result[67].buffer_length=8; bind_result[67].length=&length_result[67]; bind_result[67].is_null=&is_null_result[67]; bind_result[67].error=&error_result[67]; bind_result[68].buffer_type=MYSQL_TYPE_LONG; bind_result[68].buffer=alocmem(4); bind_result[68].buffer_length=4; bind_result[68].length=&length_result[68]; bind_result[68].is_null=&is_null_result[68]; bind_result[68].error=&error_result[68]; bind_result[69].buffer_type=MYSQL_TYPE_LONGLONG; bind_result[69].buffer=alocmem(8); bind_result[69].buffer_length=8; bind_result[69].length=&length_result[69]; bind_result[69].is_null=&is_null_result[69]; bind_result[69].error=&error_result[69]; bind_result[70].buffer_type=MYSQL_TYPE_TINY; bind_result[70].buffer=alocmem(1); bind_result[70].buffer_length=1; bind_result[70].length=&length_result[70]; bind_result[70].is_null=&is_null_result[70]; bind_result[70].error=&error_result[70]; bind_result[71].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[71].buffer=alocmem(8); bind_result[71].buffer_length=8; bind_result[71].length=&length_result[71]; bind_result[71].is_null=&is_null_result[71]; bind_result[71].error=&error_result[71]; bind_result[72].buffer_type=MYSQL_TYPE_BLOB; bind_result[72].buffer=alocmem(10240); bind_result[72].buffer_length=10240; bind_result[72].length=&length_result[72]; bind_result[72].is_null=&is_null_result[72]; bind_result[72].error=&error_result[72]; bind_result[73].buffer_type=MYSQL_TYPE_TIME; bind_result[73].buffer=alocmem(36); bind_result[73].buffer_length=36; bind_result[73].length=&length_result[73]; bind_result[73].is_null=&is_null_result[73]; bind_result[73].error=&error_result[73]; bind_result[74].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[74].buffer=alocmem(8); bind_result[74].buffer_length=8; bind_result[74].length=&length_result[74]; bind_result[74].is_null=&is_null_result[74]; bind_result[74].error=&error_result[74]; bind_result[75].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[75].buffer=alocmem(8); bind_result[75].buffer_length=8; bind_result[75].length=&length_result[75]; bind_result[75].is_null=&is_null_result[75]; bind_result[75].error=&error_result[75]; bind_result[76].buffer_type=MYSQL_TYPE_BLOB; bind_result[76].buffer=alocmem(255); bind_result[76].buffer_length=255; bind_result[76].length=&length_result[76]; bind_result[76].is_null=&is_null_result[76]; bind_result[76].error=&error_result[76]; bind_result[77].buffer_type=MYSQL_TYPE_TINY; bind_result[77].buffer=alocmem(1); bind_result[77].buffer_length=1; bind_result[77].length=&length_result[77]; bind_result[77].is_null=&is_null_result[77]; bind_result[77].error=&error_result[77]; repeat_count=2; for(i=0;i<repeat_count;i++) { if(mysql_stmt_execute(stmt)) { printf("[ps_func_0002] mysql_stmt_execute failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } num_queries++; if(mysql_stmt_bind_result(stmt,bind_result)) { printf("[ps_func_0002] mysql_stmt_bind_result failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } if(mysql_stmt_store_result(stmt)) { printf("[ps_func_0002] mysql_stmt_store_result failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } while (!mysql_stmt_fetch(stmt)) { } } end: if(NULL != stmt && mysql_stmt_close(stmt)) { printf("[ps_func_0002] mysql_stmt_close failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; } if(NULL!=bind_result[0].buffer) free(bind_result[0].buffer); if(NULL!=bind_result[1].buffer) free(bind_result[1].buffer); if(NULL!=bind_result[2].buffer) free(bind_result[2].buffer); if(NULL!=bind_result[3].buffer) free(bind_result[3].buffer); if(NULL!=bind_result[4].buffer) free(bind_result[4].buffer); if(NULL!=bind_result[5].buffer) free(bind_result[5].buffer); if(NULL!=bind_result[6].buffer) free(bind_result[6].buffer); if(NULL!=bind_result[7].buffer) free(bind_result[7].buffer); if(NULL!=bind_result[8].buffer) free(bind_result[8].buffer); if(NULL!=bind_result[9].buffer) free(bind_result[9].buffer); if(NULL!=bind_result[10].buffer) free(bind_result[10].buffer); if(NULL!=bind_result[11].buffer) free(bind_result[11].buffer); if(NULL!=bind_result[12].buffer) free(bind_result[12].buffer); if(NULL!=bind_result[13].buffer) free(bind_result[13].buffer); if(NULL!=bind_result[14].buffer) free(bind_result[14].buffer); if(NULL!=bind_result[15].buffer) free(bind_result[15].buffer); if(NULL!=bind_result[16].buffer) free(bind_result[16].buffer); if(NULL!=bind_result[17].buffer) free(bind_result[17].buffer); if(NULL!=bind_result[18].buffer) free(bind_result[18].buffer); if(NULL!=bind_result[19].buffer) free(bind_result[19].buffer); if(NULL!=bind_result[20].buffer) free(bind_result[20].buffer); if(NULL!=bind_result[21].buffer) free(bind_result[21].buffer); if(NULL!=bind_result[22].buffer) free(bind_result[22].buffer); if(NULL!=bind_result[23].buffer) free(bind_result[23].buffer); if(NULL!=bind_result[24].buffer) free(bind_result[24].buffer); if(NULL!=bind_result[25].buffer) free(bind_result[25].buffer); if(NULL!=bind_result[26].buffer) free(bind_result[26].buffer); if(NULL!=bind_result[27].buffer) free(bind_result[27].buffer); if(NULL!=bind_result[28].buffer) free(bind_result[28].buffer); if(NULL!=bind_result[29].buffer) free(bind_result[29].buffer); if(NULL!=bind_result[30].buffer) free(bind_result[30].buffer); if(NULL!=bind_result[31].buffer) free(bind_result[31].buffer); if(NULL!=bind_result[32].buffer) free(bind_result[32].buffer); if(NULL!=bind_result[33].buffer) free(bind_result[33].buffer); if(NULL!=bind_result[34].buffer) free(bind_result[34].buffer); if(NULL!=bind_result[35].buffer) free(bind_result[35].buffer); if(NULL!=bind_result[36].buffer) free(bind_result[36].buffer); if(NULL!=bind_result[37].buffer) free(bind_result[37].buffer); if(NULL!=bind_result[38].buffer) free(bind_result[38].buffer); if(NULL!=bind_result[39].buffer) free(bind_result[39].buffer); if(NULL!=bind_result[40].buffer) free(bind_result[40].buffer); if(NULL!=bind_result[41].buffer) free(bind_result[41].buffer); if(NULL!=bind_result[42].buffer) free(bind_result[42].buffer); if(NULL!=bind_result[43].buffer) free(bind_result[43].buffer); if(NULL!=bind_result[44].buffer) free(bind_result[44].buffer); if(NULL!=bind_result[45].buffer) free(bind_result[45].buffer); if(NULL!=bind_result[46].buffer) free(bind_result[46].buffer); if(NULL!=bind_result[47].buffer) free(bind_result[47].buffer); if(NULL!=bind_result[48].buffer) free(bind_result[48].buffer); if(NULL!=bind_result[49].buffer) free(bind_result[49].buffer); if(NULL!=bind_result[50].buffer) free(bind_result[50].buffer); if(NULL!=bind_result[51].buffer) free(bind_result[51].buffer); if(NULL!=bind_result[52].buffer) free(bind_result[52].buffer); if(NULL!=bind_result[53].buffer) free(bind_result[53].buffer); if(NULL!=bind_result[54].buffer) free(bind_result[54].buffer); if(NULL!=bind_result[55].buffer) free(bind_result[55].buffer); if(NULL!=bind_result[56].buffer) free(bind_result[56].buffer); if(NULL!=bind_result[57].buffer) free(bind_result[57].buffer); if(NULL!=bind_result[58].buffer) free(bind_result[58].buffer); if(NULL!=bind_result[59].buffer) free(bind_result[59].buffer); if(NULL!=bind_result[60].buffer) free(bind_result[60].buffer); if(NULL!=bind_result[61].buffer) free(bind_result[61].buffer); if(NULL!=bind_result[62].buffer) free(bind_result[62].buffer); if(NULL!=bind_result[63].buffer) free(bind_result[63].buffer); if(NULL!=bind_result[64].buffer) free(bind_result[64].buffer); if(NULL!=bind_result[65].buffer) free(bind_result[65].buffer); if(NULL!=bind_result[66].buffer) free(bind_result[66].buffer); if(NULL!=bind_result[67].buffer) free(bind_result[67].buffer); if(NULL!=bind_result[68].buffer) free(bind_result[68].buffer); if(NULL!=bind_result[69].buffer) free(bind_result[69].buffer); if(NULL!=bind_result[70].buffer) free(bind_result[70].buffer); if(NULL!=bind_result[71].buffer) free(bind_result[71].buffer); if(NULL!=bind_result[72].buffer) free(bind_result[72].buffer); if(NULL!=bind_result[73].buffer) free(bind_result[73].buffer); if(NULL!=bind_result[74].buffer) free(bind_result[74].buffer); if(NULL!=bind_result[75].buffer) free(bind_result[75].buffer); if(NULL!=bind_result[76].buffer) free(bind_result[76].buffer); if(NULL!=bind_result[77].buffer) free(bind_result[77].buffer); if(1==error) goto err; return 1; err: return 0; } int ps_func_0003(MYSQL *db) { char *query="select * from `table0003` limit 1"; MYSQL_STMT *stmt=NULL; unsigned int val=0; int i=0; int error=0; unsigned int repeat_count=0; MYSQL_BIND bind_result[77]; unsigned long length_result[77]; my_bool is_null_result[77]; my_bool error_result[77]; memset(bind_result, 0, sizeof(bind_result)); stmt= mysql_stmt_init(db); if (NULL == stmt) { printf("[ps_func_0003] mysql_stmt_init failed: %s (%d) (%s)\n",mysql_error(db),mysql_errno(db),mysql_sqlstate(db)); error=1; goto end; } if(mysql_stmt_prepare(stmt,query,(unsigned long)strlen(query))) { printf("[ps_func_0003] mysql_stmt_prepare failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } val=1; if(mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void *)&val)) { printf("[ps_func_0003] mysql_stmt_attr_set: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } val=CURSOR_TYPE_READ_ONLY; if(mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void *)&val)) { printf("[ps_func_0003] mysql_stmt_attr_set: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } val=5000; if(mysql_stmt_attr_set(stmt, STMT_ATTR_PREFETCH_ROWS, (void *)&val)) { printf("[ps_func_0003] mysql_stmt_attr_set: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } bind_result[0].buffer_type=MYSQL_TYPE_DATETIME; bind_result[0].buffer=alocmem(36); bind_result[0].buffer_length=36; bind_result[0].length=&length_result[0]; bind_result[0].is_null=&is_null_result[0]; bind_result[0].error=&error_result[0]; bind_result[1].buffer_type=MYSQL_TYPE_DATETIME; bind_result[1].buffer=alocmem(36); bind_result[1].buffer_length=36; bind_result[1].length=&length_result[1]; bind_result[1].is_null=&is_null_result[1]; bind_result[1].error=&error_result[1]; bind_result[2].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[2].buffer=alocmem(8); bind_result[2].buffer_length=8; bind_result[2].length=&length_result[2]; bind_result[2].is_null=&is_null_result[2]; bind_result[2].error=&error_result[2]; bind_result[3].buffer_type=MYSQL_TYPE_NEWDECIMAL; bind_result[3].buffer=alocmem(11); bind_result[3].buffer_length=11; bind_result[3].length=&length_result[3]; bind_result[3].is_null=&is_null_result[3]; bind_result[3].error=&error_result[3]; bind_result[4].buffer_type=MYSQL_TYPE_BLOB; bind_result[4].buffer=alocmem(10240); bind_result[4].buffer_length=10240; bind_result[4].length=&length_result[4]; bind_result[4].is_null=&is_null_result[4]; bind_result[4].error=&error_result[4]; bind_result[5].buffer_type=MYSQL_TYPE_LONGLONG; bind_result[5].buffer=alocmem(8); bind_result[5].buffer_length=8; bind_result[5].length=&length_result[5]; bind_result[5].is_null=&is_null_result[5]; bind_result[5].error=&error_result[5]; bind_result[6].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[6].buffer=alocmem(8); bind_result[6].buffer_length=8; bind_result[6].length=&length_result[6]; bind_result[6].is_null=&is_null_result[6]; bind_result[6].error=&error_result[6]; bind_result[7].buffer_type=MYSQL_TYPE_LONGLONG; bind_result[7].buffer=alocmem(8); bind_result[7].buffer_length=8; bind_result[7].length=&length_result[7]; bind_result[7].is_null=&is_null_result[7]; bind_result[7].error=&error_result[7]; bind_result[8].buffer_type=MYSQL_TYPE_STRING; bind_result[8].buffer=alocmem(99); bind_result[8].buffer_length=99; bind_result[8].length=&length_result[8]; bind_result[8].is_null=&is_null_result[8]; bind_result[8].error=&error_result[8]; bind_result[9].buffer_type=MYSQL_TYPE_TIMESTAMP; bind_result[9].buffer=alocmem(36); bind_result[9].buffer_length=36; bind_result[9].length=&length_result[9]; bind_result[9].is_null=&is_null_result[9]; bind_result[9].error=&error_result[9]; bind_result[10].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[10].buffer=alocmem(8); bind_result[10].buffer_length=8; bind_result[10].length=&length_result[10]; bind_result[10].is_null=&is_null_result[10]; bind_result[10].error=&error_result[10]; bind_result[11].buffer_type=MYSQL_TYPE_INT24; bind_result[11].buffer=alocmem(4); bind_result[11].buffer_length=4; bind_result[11].length=&length_result[11]; bind_result[11].is_null=&is_null_result[11]; bind_result[11].error=&error_result[11]; bind_result[12].buffer_type=MYSQL_TYPE_DATETIME; bind_result[12].buffer=alocmem(36); bind_result[12].buffer_length=36; bind_result[12].length=&length_result[12]; bind_result[12].is_null=&is_null_result[12]; bind_result[12].error=&error_result[12]; bind_result[13].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[13].buffer=alocmem(8); bind_result[13].buffer_length=8; bind_result[13].length=&length_result[13]; bind_result[13].is_null=&is_null_result[13]; bind_result[13].error=&error_result[13]; bind_result[14].buffer_type=MYSQL_TYPE_BLOB; bind_result[14].buffer=alocmem(10240); bind_result[14].buffer_length=10240; bind_result[14].length=&length_result[14]; bind_result[14].is_null=&is_null_result[14]; bind_result[14].error=&error_result[14]; bind_result[15].buffer_type=MYSQL_TYPE_BLOB; bind_result[15].buffer=alocmem(10240); bind_result[15].buffer_length=10240; bind_result[15].length=&length_result[15]; bind_result[15].is_null=&is_null_result[15]; bind_result[15].error=&error_result[15]; bind_result[16].buffer_type=MYSQL_TYPE_BLOB; bind_result[16].buffer=alocmem(255); bind_result[16].buffer_length=255; bind_result[16].length=&length_result[16]; bind_result[16].is_null=&is_null_result[16]; bind_result[16].error=&error_result[16]; bind_result[17].buffer_type=MYSQL_TYPE_LONG; bind_result[17].buffer=alocmem(4); bind_result[17].buffer_length=4; bind_result[17].length=&length_result[17]; bind_result[17].is_null=&is_null_result[17]; bind_result[17].error=&error_result[17]; bind_result[18].buffer_type=MYSQL_TYPE_VAR_STRING; bind_result[18].buffer=alocmem(153); bind_result[18].buffer_length=153; bind_result[18].length=&length_result[18]; bind_result[18].is_null=&is_null_result[18]; bind_result[18].error=&error_result[18]; bind_result[19].buffer_type=MYSQL_TYPE_BLOB; bind_result[19].buffer=alocmem(10240); bind_result[19].buffer_length=10240; bind_result[19].length=&length_result[19]; bind_result[19].is_null=&is_null_result[19]; bind_result[19].error=&error_result[19]; bind_result[20].buffer_type=MYSQL_TYPE_TINY; bind_result[20].buffer=alocmem(1); bind_result[20].buffer_length=1; bind_result[20].length=&length_result[20]; bind_result[20].is_null=&is_null_result[20]; bind_result[20].error=&error_result[20]; bind_result[21].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[21].buffer=alocmem(8); bind_result[21].buffer_length=8; bind_result[21].length=&length_result[21]; bind_result[21].is_null=&is_null_result[21]; bind_result[21].error=&error_result[21]; bind_result[22].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[22].buffer=alocmem(8); bind_result[22].buffer_length=8; bind_result[22].length=&length_result[22]; bind_result[22].is_null=&is_null_result[22]; bind_result[22].error=&error_result[22]; bind_result[23].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[23].buffer=alocmem(8); bind_result[23].buffer_length=8; bind_result[23].length=&length_result[23]; bind_result[23].is_null=&is_null_result[23]; bind_result[23].error=&error_result[23]; bind_result[24].buffer_type=MYSQL_TYPE_TINY; bind_result[24].buffer=alocmem(1); bind_result[24].buffer_length=1; bind_result[24].length=&length_result[24]; bind_result[24].is_null=&is_null_result[24]; bind_result[24].error=&error_result[24]; bind_result[25].buffer_type=MYSQL_TYPE_TINY; bind_result[25].buffer=alocmem(1); bind_result[25].buffer_length=1; bind_result[25].length=&length_result[25]; bind_result[25].is_null=&is_null_result[25]; bind_result[25].error=&error_result[25]; bind_result[26].buffer_type=MYSQL_TYPE_LONGLONG; bind_result[26].buffer=alocmem(8); bind_result[26].buffer_length=8; bind_result[26].length=&length_result[26]; bind_result[26].is_null=&is_null_result[26]; bind_result[26].error=&error_result[26]; bind_result[27].buffer_type=MYSQL_TYPE_BLOB; bind_result[27].buffer=alocmem(10240); bind_result[27].buffer_length=10240; bind_result[27].length=&length_result[27]; bind_result[27].is_null=&is_null_result[27]; bind_result[27].error=&error_result[27]; bind_result[28].buffer_type=MYSQL_TYPE_LONGLONG; bind_result[28].buffer=alocmem(8); bind_result[28].buffer_length=8; bind_result[28].length=&length_result[28]; bind_result[28].is_null=&is_null_result[28]; bind_result[28].error=&error_result[28]; bind_result[29].buffer_type=MYSQL_TYPE_BLOB; bind_result[29].buffer=alocmem(10240); bind_result[29].buffer_length=10240; bind_result[29].length=&length_result[29]; bind_result[29].is_null=&is_null_result[29]; bind_result[29].error=&error_result[29]; bind_result[30].buffer_type=MYSQL_TYPE_VAR_STRING; bind_result[30].buffer=alocmem(110); bind_result[30].buffer_length=110; bind_result[30].length=&length_result[30]; bind_result[30].is_null=&is_null_result[30]; bind_result[30].error=&error_result[30]; bind_result[31].buffer_type=MYSQL_TYPE_INT24; bind_result[31].buffer=alocmem(4); bind_result[31].buffer_length=4; bind_result[31].length=&length_result[31]; bind_result[31].is_null=&is_null_result[31]; bind_result[31].error=&error_result[31]; bind_result[32].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[32].buffer=alocmem(8); bind_result[32].buffer_length=8; bind_result[32].length=&length_result[32]; bind_result[32].is_null=&is_null_result[32]; bind_result[32].error=&error_result[32]; bind_result[33].buffer_type=MYSQL_TYPE_BLOB; bind_result[33].buffer=alocmem(10240); bind_result[33].buffer_length=10240; bind_result[33].length=&length_result[33]; bind_result[33].is_null=&is_null_result[33]; bind_result[33].error=&error_result[33]; bind_result[34].buffer_type=MYSQL_TYPE_DATETIME; bind_result[34].buffer=alocmem(36); bind_result[34].buffer_length=36; bind_result[34].length=&length_result[34]; bind_result[34].is_null=&is_null_result[34]; bind_result[34].error=&error_result[34]; bind_result[35].buffer_type=MYSQL_TYPE_STRING; bind_result[35].buffer=alocmem(229); bind_result[35].buffer_length=229; bind_result[35].length=&length_result[35]; bind_result[35].is_null=&is_null_result[35]; bind_result[35].error=&error_result[35]; bind_result[36].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[36].buffer=alocmem(8); bind_result[36].buffer_length=8; bind_result[36].length=&length_result[36]; bind_result[36].is_null=&is_null_result[36]; bind_result[36].error=&error_result[36]; bind_result[37].buffer_type=MYSQL_TYPE_BLOB; bind_result[37].buffer=alocmem(10240); bind_result[37].buffer_length=10240; bind_result[37].length=&length_result[37]; bind_result[37].is_null=&is_null_result[37]; bind_result[37].error=&error_result[37]; bind_result[38].buffer_type=MYSQL_TYPE_BLOB; bind_result[38].buffer=alocmem(10240); bind_result[38].buffer_length=10240; bind_result[38].length=&length_result[38]; bind_result[38].is_null=&is_null_result[38]; bind_result[38].error=&error_result[38]; bind_result[39].buffer_type=MYSQL_TYPE_BLOB; bind_result[39].buffer=alocmem(10240); bind_result[39].buffer_length=10240; bind_result[39].length=&length_result[39]; bind_result[39].is_null=&is_null_result[39]; bind_result[39].error=&error_result[39]; bind_result[40].buffer_type=MYSQL_TYPE_BLOB; bind_result[40].buffer=alocmem(10240); bind_result[40].buffer_length=10240; bind_result[40].length=&length_result[40]; bind_result[40].is_null=&is_null_result[40]; bind_result[40].error=&error_result[40]; bind_result[41].buffer_type=MYSQL_TYPE_BLOB; bind_result[41].buffer=alocmem(10240); bind_result[41].buffer_length=10240; bind_result[41].length=&length_result[41]; bind_result[41].is_null=&is_null_result[41]; bind_result[41].error=&error_result[41]; bind_result[42].buffer_type=MYSQL_TYPE_NEWDECIMAL; bind_result[42].buffer=alocmem(11); bind_result[42].buffer_length=11; bind_result[42].length=&length_result[42]; bind_result[42].is_null=&is_null_result[42]; bind_result[42].error=&error_result[42]; bind_result[43].buffer_type=MYSQL_TYPE_TINY; bind_result[43].buffer=alocmem(1); bind_result[43].buffer_length=1; bind_result[43].length=&length_result[43]; bind_result[43].is_null=&is_null_result[43]; bind_result[43].error=&error_result[43]; bind_result[44].buffer_type=MYSQL_TYPE_FLOAT; bind_result[44].buffer=alocmem(4); bind_result[44].buffer_length=4; bind_result[44].length=&length_result[44]; bind_result[44].is_null=&is_null_result[44]; bind_result[44].error=&error_result[44]; bind_result[45].buffer_type=MYSQL_TYPE_DATETIME; bind_result[45].buffer=alocmem(36); bind_result[45].buffer_length=36; bind_result[45].length=&length_result[45]; bind_result[45].is_null=&is_null_result[45]; bind_result[45].error=&error_result[45]; bind_result[46].buffer_type=MYSQL_TYPE_FLOAT; bind_result[46].buffer=alocmem(4); bind_result[46].buffer_length=4; bind_result[46].length=&length_result[46]; bind_result[46].is_null=&is_null_result[46]; bind_result[46].error=&error_result[46]; bind_result[47].buffer_type=MYSQL_TYPE_STRING; bind_result[47].buffer=alocmem(126); bind_result[47].buffer_length=126; bind_result[47].length=&length_result[47]; bind_result[47].is_null=&is_null_result[47]; bind_result[47].error=&error_result[47]; bind_result[48].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[48].buffer=alocmem(8); bind_result[48].buffer_length=8; bind_result[48].length=&length_result[48]; bind_result[48].is_null=&is_null_result[48]; bind_result[48].error=&error_result[48]; bind_result[49].buffer_type=MYSQL_TYPE_BLOB; bind_result[49].buffer=alocmem(10240); bind_result[49].buffer_length=10240; bind_result[49].length=&length_result[49]; bind_result[49].is_null=&is_null_result[49]; bind_result[49].error=&error_result[49]; bind_result[50].buffer_type=MYSQL_TYPE_DATETIME; bind_result[50].buffer=alocmem(36); bind_result[50].buffer_length=36; bind_result[50].length=&length_result[50]; bind_result[50].is_null=&is_null_result[50]; bind_result[50].error=&error_result[50]; bind_result[51].buffer_type=MYSQL_TYPE_INT24; bind_result[51].buffer=alocmem(4); bind_result[51].buffer_length=4; bind_result[51].length=&length_result[51]; bind_result[51].is_null=&is_null_result[51]; bind_result[51].error=&error_result[51]; bind_result[52].buffer_type=MYSQL_TYPE_BLOB; bind_result[52].buffer=alocmem(10240); bind_result[52].buffer_length=10240; bind_result[52].length=&length_result[52]; bind_result[52].is_null=&is_null_result[52]; bind_result[52].error=&error_result[52]; bind_result[53].buffer_type=MYSQL_TYPE_YEAR; bind_result[53].buffer=alocmem(4); bind_result[53].buffer_length=4; bind_result[53].length=&length_result[53]; bind_result[53].is_null=&is_null_result[53]; bind_result[53].error=&error_result[53]; bind_result[54].buffer_type=MYSQL_TYPE_BLOB; bind_result[54].buffer=alocmem(10240); bind_result[54].buffer_length=10240; bind_result[54].length=&length_result[54]; bind_result[54].is_null=&is_null_result[54]; bind_result[54].error=&error_result[54]; bind_result[55].buffer_type=MYSQL_TYPE_BLOB; bind_result[55].buffer=alocmem(10240); bind_result[55].buffer_length=10240; bind_result[55].length=&length_result[55]; bind_result[55].is_null=&is_null_result[55]; bind_result[55].error=&error_result[55]; bind_result[56].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[56].buffer=alocmem(8); bind_result[56].buffer_length=8; bind_result[56].length=&length_result[56]; bind_result[56].is_null=&is_null_result[56]; bind_result[56].error=&error_result[56]; bind_result[57].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[57].buffer=alocmem(8); bind_result[57].buffer_length=8; bind_result[57].length=&length_result[57]; bind_result[57].is_null=&is_null_result[57]; bind_result[57].error=&error_result[57]; bind_result[58].buffer_type=MYSQL_TYPE_TIMESTAMP; bind_result[58].buffer=alocmem(36); bind_result[58].buffer_length=36; bind_result[58].length=&length_result[58]; bind_result[58].is_null=&is_null_result[58]; bind_result[58].error=&error_result[58]; bind_result[59].buffer_type=MYSQL_TYPE_TIME; bind_result[59].buffer=alocmem(36); bind_result[59].buffer_length=36; bind_result[59].length=&length_result[59]; bind_result[59].is_null=&is_null_result[59]; bind_result[59].error=&error_result[59]; bind_result[60].buffer_type=MYSQL_TYPE_TIMESTAMP; bind_result[60].buffer=alocmem(36); bind_result[60].buffer_length=36; bind_result[60].length=&length_result[60]; bind_result[60].is_null=&is_null_result[60]; bind_result[60].error=&error_result[60]; bind_result[61].buffer_type=MYSQL_TYPE_BLOB; bind_result[61].buffer=alocmem(10240); bind_result[61].buffer_length=10240; bind_result[61].length=&length_result[61]; bind_result[61].is_null=&is_null_result[61]; bind_result[61].error=&error_result[61]; bind_result[62].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[62].buffer=alocmem(8); bind_result[62].buffer_length=8; bind_result[62].length=&length_result[62]; bind_result[62].is_null=&is_null_result[62]; bind_result[62].error=&error_result[62]; bind_result[63].buffer_type=MYSQL_TYPE_TINY; bind_result[63].buffer=alocmem(1); bind_result[63].buffer_length=1; bind_result[63].length=&length_result[63]; bind_result[63].is_null=&is_null_result[63]; bind_result[63].error=&error_result[63]; bind_result[64].buffer_type=MYSQL_TYPE_BLOB; bind_result[64].buffer=alocmem(10240); bind_result[64].buffer_length=10240; bind_result[64].length=&length_result[64]; bind_result[64].is_null=&is_null_result[64]; bind_result[64].error=&error_result[64]; bind_result[65].buffer_type=MYSQL_TYPE_BLOB; bind_result[65].buffer=alocmem(10240); bind_result[65].buffer_length=10240; bind_result[65].length=&length_result[65]; bind_result[65].is_null=&is_null_result[65]; bind_result[65].error=&error_result[65]; bind_result[66].buffer_type=MYSQL_TYPE_BLOB; bind_result[66].buffer=alocmem(10240); bind_result[66].buffer_length=10240; bind_result[66].length=&length_result[66]; bind_result[66].is_null=&is_null_result[66]; bind_result[66].error=&error_result[66]; bind_result[67].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[67].buffer=alocmem(8); bind_result[67].buffer_length=8; bind_result[67].length=&length_result[67]; bind_result[67].is_null=&is_null_result[67]; bind_result[67].error=&error_result[67]; bind_result[68].buffer_type=MYSQL_TYPE_LONG; bind_result[68].buffer=alocmem(4); bind_result[68].buffer_length=4; bind_result[68].length=&length_result[68]; bind_result[68].is_null=&is_null_result[68]; bind_result[68].error=&error_result[68]; bind_result[69].buffer_type=MYSQL_TYPE_TINY; bind_result[69].buffer=alocmem(1); bind_result[69].buffer_length=1; bind_result[69].length=&length_result[69]; bind_result[69].is_null=&is_null_result[69]; bind_result[69].error=&error_result[69]; bind_result[70].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[70].buffer=alocmem(8); bind_result[70].buffer_length=8; bind_result[70].length=&length_result[70]; bind_result[70].is_null=&is_null_result[70]; bind_result[70].error=&error_result[70]; bind_result[71].buffer_type=MYSQL_TYPE_TINY; bind_result[71].buffer=alocmem(1); bind_result[71].buffer_length=1; bind_result[71].length=&length_result[71]; bind_result[71].is_null=&is_null_result[71]; bind_result[71].error=&error_result[71]; bind_result[72].buffer_type=MYSQL_TYPE_STRING; bind_result[72].buffer=alocmem(204); bind_result[72].buffer_length=204; bind_result[72].length=&length_result[72]; bind_result[72].is_null=&is_null_result[72]; bind_result[72].error=&error_result[72]; bind_result[73].buffer_type=MYSQL_TYPE_TIMESTAMP; bind_result[73].buffer=alocmem(36); bind_result[73].buffer_length=36; bind_result[73].length=&length_result[73]; bind_result[73].is_null=&is_null_result[73]; bind_result[73].error=&error_result[73]; bind_result[74].buffer_type=MYSQL_TYPE_YEAR; bind_result[74].buffer=alocmem(4); bind_result[74].buffer_length=4; bind_result[74].length=&length_result[74]; bind_result[74].is_null=&is_null_result[74]; bind_result[74].error=&error_result[74]; bind_result[75].buffer_type=MYSQL_TYPE_FLOAT; bind_result[75].buffer=alocmem(4); bind_result[75].buffer_length=4; bind_result[75].length=&length_result[75]; bind_result[75].is_null=&is_null_result[75]; bind_result[75].error=&error_result[75]; bind_result[76].buffer_type=MYSQL_TYPE_DOUBLE; bind_result[76].buffer=alocmem(8); bind_result[76].buffer_length=8; bind_result[76].length=&length_result[76]; bind_result[76].is_null=&is_null_result[76]; bind_result[76].error=&error_result[76]; repeat_count=2; for(i=0;i<repeat_count;i++) { if(mysql_stmt_execute(stmt)) { printf("[ps_func_0003] mysql_stmt_execute failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } num_queries++; if(mysql_stmt_bind_result(stmt,bind_result)) { printf("[ps_func_0003] mysql_stmt_bind_result failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } if(mysql_stmt_store_result(stmt)) { printf("[ps_func_0003] mysql_stmt_store_result failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; goto end; } while (!mysql_stmt_fetch(stmt)) { } } end: if(NULL != stmt && mysql_stmt_close(stmt)) { printf("[ps_func_0003] mysql_stmt_close failed: %s (%d) (%s)\n",mysql_stmt_error(stmt),mysql_stmt_errno(stmt),mysql_stmt_sqlstate(stmt)); error=1; } if(NULL!=bind_result[0].buffer) free(bind_result[0].buffer); if(NULL!=bind_result[1].buffer) free(bind_result[1].buffer); if(NULL!=bind_result[2].buffer) free(bind_result[2].buffer); if(NULL!=bind_result[3].buffer) free(bind_result[3].buffer); if(NULL!=bind_result[4].buffer) free(bind_result[4].buffer); if(NULL!=bind_result[5].buffer) free(bind_result[5].buffer); if(NULL!=bind_result[6].buffer) free(bind_result[6].buffer); if(NULL!=bind_result[7].buffer) free(bind_result[7].buffer); if(NULL!=bind_result[8].buffer) free(bind_result[8].buffer); if(NULL!=bind_result[9].buffer) free(bind_result[9].buffer); if(NULL!=bind_result[10].buffer) free(bind_result[10].buffer); if(NULL!=bind_result[11].buffer) free(bind_result[11].buffer); if(NULL!=bind_result[12].buffer) free(bind_result[12].buffer); if(NULL!=bind_result[13].buffer) free(bind_result[13].buffer); if(NULL!=bind_result[14].buffer) free(bind_result[14].buffer); if(NULL!=bind_result[15].buffer) free(bind_result[15].buffer); if(NULL!=bind_result[16].buffer) free(bind_result[16].buffer); if(NULL!=bind_result[17].buffer) free(bind_result[17].buffer); if(NULL!=bind_result[18].buffer) free(bind_result[18].buffer); if(NULL!=bind_result[19].buffer) free(bind_result[19].buffer); if(NULL!=bind_result[20].buffer) free(bind_result[20].buffer); if(NULL!=bind_result[21].buffer) free(bind_result[21].buffer); if(NULL!=bind_result[22].buffer) free(bind_result[22].buffer); if(NULL!=bind_result[23].buffer) free(bind_result[23].buffer); if(NULL!=bind_result[24].buffer) free(bind_result[24].buffer); if(NULL!=bind_result[25].buffer) free(bind_result[25].buffer); if(NULL!=bind_result[26].buffer) free(bind_result[26].buffer); if(NULL!=bind_result[27].buffer) free(bind_result[27].buffer); if(NULL!=bind_result[28].buffer) free(bind_result[28].buffer); if(NULL!=bind_result[29].buffer) free(bind_result[29].buffer); if(NULL!=bind_result[30].buffer) free(bind_result[30].buffer); if(NULL!=bind_result[31].buffer) free(bind_result[31].buffer); if(NULL!=bind_result[32].buffer) free(bind_result[32].buffer); if(NULL!=bind_result[33].buffer) free(bind_result[33].buffer); if(NULL!=bind_result[34].buffer) free(bind_result[34].buffer); if(NULL!=bind_result[35].buffer) free(bind_result[35].buffer); if(NULL!=bind_result[36].buffer) free(bind_result[36].buffer); if(NULL!=bind_result[37].buffer) free(bind_result[37].buffer); if(NULL!=bind_result[38].buffer) free(bind_result[38].buffer); if(NULL!=bind_result[39].buffer) free(bind_result[39].buffer); if(NULL!=bind_result[40].buffer) free(bind_result[40].buffer); if(NULL!=bind_result[41].buffer) free(bind_result[41].buffer); if(NULL!=bind_result[42].buffer) free(bind_result[42].buffer); if(NULL!=bind_result[43].buffer) free(bind_result[43].buffer); if(NULL!=bind_result[44].buffer) free(bind_result[44].buffer); if(NULL!=bind_result[45].buffer) free(bind_result[45].buffer); if(NULL!=bind_result[46].buffer) free(bind_result[46].buffer); if(NULL!=bind_result[47].buffer) free(bind_result[47].buffer); if(NULL!=bind_result[48].buffer) free(bind_result[48].buffer); if(NULL!=bind_result[49].buffer) free(bind_result[49].buffer); if(NULL!=bind_result[50].buffer) free(bind_result[50].buffer); if(NULL!=bind_result[51].buffer) free(bind_result[51].buffer); if(NULL!=bind_result[52].buffer) free(bind_result[52].buffer); if(NULL!=bind_result[53].buffer) free(bind_result[53].buffer); if(NULL!=bind_result[54].buffer) free(bind_result[54].buffer); if(NULL!=bind_result[55].buffer) free(bind_result[55].buffer); if(NULL!=bind_result[56].buffer) free(bind_result[56].buffer); if(NULL!=bind_result[57].buffer) free(bind_result[57].buffer); if(NULL!=bind_result[58].buffer) free(bind_result[58].buffer); if(NULL!=bind_result[59].buffer) free(bind_result[59].buffer); if(NULL!=bind_result[60].buffer) free(bind_result[60].buffer); if(NULL!=bind_result[61].buffer) free(bind_result[61].buffer); if(NULL!=bind_result[62].buffer) free(bind_result[62].buffer); if(NULL!=bind_result[63].buffer) free(bind_result[63].buffer); if(NULL!=bind_result[64].buffer) free(bind_result[64].buffer); if(NULL!=bind_result[65].buffer) free(bind_result[65].buffer); if(NULL!=bind_result[66].buffer) free(bind_result[66].buffer); if(NULL!=bind_result[67].buffer) free(bind_result[67].buffer); if(NULL!=bind_result[68].buffer) free(bind_result[68].buffer); if(NULL!=bind_result[69].buffer) free(bind_result[69].buffer); if(NULL!=bind_result[70].buffer) free(bind_result[70].buffer); if(NULL!=bind_result[71].buffer) free(bind_result[71].buffer); if(NULL!=bind_result[72].buffer) free(bind_result[72].buffer); if(NULL!=bind_result[73].buffer) free(bind_result[73].buffer); if(NULL!=bind_result[74].buffer) free(bind_result[74].buffer); if(NULL!=bind_result[75].buffer) free(bind_result[75].buffer); if(NULL!=bind_result[76].buffer) free(bind_result[76].buffer); if(1==error) goto err; return 1; err: return 0; }