//gcc bug47012.c -Wall -g -o bug47012 -L/home/sbester/mysql/5.5/mysql-5.5.16-linux2.6-x86_64/lib -I/home/sbester/mysql/5.5/mysql-5.5.16-linux2.6-x86_64/include -lmysqlclient_r -lz -lm -lpthread #include #include #include #include #include #include #include #define TESTTIME (3600) #define NUMTHREADS (7) #define DATASIZE (16*1024*1024) char host[]="192.168.1.2"; 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 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