// This cpp file is a generated trace that consists of the following "sections": // // - Connection parameters for mysql_real_connect: // - Helper functions // - The actual trace (marked by ****** Begin/End of trace ******) // - Functions to create and populate the necessary tables // - A dump of the current mysql variables // This cpp file should be compilable with: // gcc -g -I ${MYSQL_DIR}/include ${THIS_FILE} ${MYSQL_DIR}/lib/libmysqlclient.a -lm -lz -lstdc++ // To replay the trace you should have a database "baan", or you can change the // DB_NAME variable below. // You should also have two users: bsp/bsp, who has SELECT, INSERT, UPDATE, DELETE // privileges on all objects and baan/baan (the owner), who has ALL PRIVILEGES. // You may choose to use other users/passwords by changing the USER_*/OWNER_* // variables below. // You can connect to MySQL through TCP/IP by setting the HOST_NAME variable, or // you can use sockets by setting HOST_NAME to NULL and setting the right UNIX_SOCKET. // // The trace replays successfully if the program silently terminates with exit status 0. #include #include #include #include #include // Connection parameters const char *HOST_NAME = NULL; const char *USER_NAME = "bsp"; const char *USER_PWD = "bsp"; const char *DB_NAME = "baan"; const char *UNIX_SOCKET = "/var/lib/mysql/mysql.sock"; // For ddl statements we use a different user/pwd const char *OWNER_NAME = "baan"; const char *OWNER_PWD = "baan"; // use "#define ASSERT_EQ (void)" to disable data validation #define ASSERT(C) assert(C) #define ASSERT_EQ(X,Y) assert( check_eq(X,Y) ) #define ASSERT_EQ_DATETIME(X,Y,M,D,h,m,s) assert( check_eq_datetime(X,Y,M,D,h,m,s) ) #include "mysql.h" void create_tables(void); // Global variables const char *stmt_text; int mysql_ret; int count; int mysql_err; MYSQL_TIME mysql_time; MYSQL_RES *mysql_result; MYSQL_ROW mysql_row; const unsigned long select_cursor = CURSOR_TYPE_READ_ONLY; const unsigned long update_cursor = CURSOR_TYPE_FOR_UPDATE; const unsigned long no_cursor = CURSOR_TYPE_NO_CURSOR; // Helper functions void set_bind_attrs( MYSQL_BIND *mysql_bind, enum_field_types ext_type, void *buf, int bufsz, unsigned long *act_len, my_bool *is_null ) { mysql_bind->buffer_type = ext_type; mysql_bind->buffer = buf; mysql_bind->length = act_len; mysql_bind->is_null = is_null; mysql_bind->buffer_length = bufsz; } void bind_time(void *ptr,int ye,int mo,int da,int ho,int mi,int se) { MYSQL_TIME t = {ye,mo,da,ho,mi,se}; memcpy(ptr,&t,sizeof(t)); } int check_eq(unsigned long v,unsigned long val) { return( v == val ); } int check_eq(void *ptr,const char *val) { return( memcmp((char*)ptr,val,strlen(val))==0); } int check_eq(void *ptr,int val) { return( *((int*)ptr) == val ); } int check_eq(void *ptr,float val) { return( *((float*)ptr) == val ); } int check_eq(void *ptr,double val) { return( *((double*)ptr) == val ); } int check_eq_datetime(void *ptr,int ye,int mo,int da,int ho,int mi,int se) { MYSQL_TIME *t = (MYSQL_TIME*)ptr; return (t->year == ye) && (t->month == mo) && (t->day == da) && (t->hour == ho) && (t->minute == mi) && (t->second == se); } int main(void) { // Create the tables needed to run this trace create_tables(); // ****** Begin of trace ****** MYSQL *sess_1; sess_1 = mysql_init( NULL ); assert(sess_1); mysql_real_connect(sess_1, HOST_NAME, USER_NAME, USER_PWD, DB_NAME, 0, UNIX_SOCKET, 0); mysql_autocommit(sess_1, 0); mysql_query(sess_1, "SET SESSION sql_mode=ERROR_FOR_DIVISION_BY_ZERO"); mysql_query(sess_1, "SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED"); MYSQL_STMT *stmt_1; stmt_1 = mysql_stmt_init(sess_1); mysql_ret = mysql_stmt_attr_set(stmt_1,STMT_ATTR_CURSOR_TYPE,(const void *) &select_cursor); assert(mysql_ret==0); stmt_text = "SELECT a0.t_projno,a0.t_respemp,a0.t_prstaff,a0.t_prstdate,a0.t_descript_1,a0.t_descript_2 FROM tdbtst160000 a0 "; mysql_ret = mysql_stmt_prepare(stmt_1,stmt_text,strlen(stmt_text)); assert(mysql_ret==0); count = mysql_stmt_param_count(stmt_1); assert( count==0 ); MYSQL_BIND *output_1 = (MYSQL_BIND *)calloc(6, sizeof(MYSQL_BIND)); char data_1[6]; unsigned long len_1; my_bool null_1; set_bind_attrs(&output_1[0],MYSQL_TYPE_VAR_STRING,&data_1,6,&len_1,&null_1); char data_2[4]; unsigned long len_2; my_bool null_2; set_bind_attrs(&output_1[1],MYSQL_TYPE_LONG,&data_2,4,&len_2,&null_2); char data_3[4]; unsigned long len_3; my_bool null_3; set_bind_attrs(&output_1[2],MYSQL_TYPE_FLOAT,&data_3,4,&len_3,&null_3); char data_4[sizeof(MYSQL_TIME)]; unsigned long len_4; my_bool null_4; set_bind_attrs(&output_1[3],MYSQL_TYPE_DATE,&data_4,36,&len_4,&null_4); char data_5[255]; unsigned long len_5; my_bool null_5; set_bind_attrs(&output_1[4],MYSQL_TYPE_VAR_STRING,&data_5,255,&len_5,&null_5); char data_6[51]; unsigned long len_6; my_bool null_6; set_bind_attrs(&output_1[5],MYSQL_TYPE_VAR_STRING,&data_6,51,&len_6,&null_6); count = mysql_warning_count(sess_1); assert(count==0); mysql_ret = mysql_stmt_execute(stmt_1); assert(mysql_ret==0); count = mysql_warning_count(sess_1); assert(count==0); mysql_stmt_bind_result(stmt_1,output_1); count = mysql_warning_count(sess_1); assert(count==0); mysql_ret = mysql_stmt_fetch(stmt_1); assert(mysql_ret==0); count = mysql_warning_count(sess_1); assert(count==0); ASSERT_EQ(len_1,6); ASSERT_EQ(data_1,"AD3100"); ASSERT_EQ(data_2,10); ASSERT_EQ(data_3,(float)6.500000); ASSERT_EQ_DATETIME(data_4, 1982,1,1,0,0,0); ASSERT_EQ(len_5,252); ASSERT_EQ(data_5,"fortune: memory fault - core dumped/* ----- this line is not intended to be a comment ----- *//* @(#) Version Maybe-2.Probably-03 (I think) */Bugs travel faster than BshellMessage of the President of this company: you are out of workSysV68: PANIC LEVEL"); ASSERT_EQ(len_6,48); ASSERT_EQ(data_6," 1 - bailing outNo dough - no diceExcuse from a "); MYSQL_STMT *stmt_2; stmt_2 = mysql_stmt_init(sess_1); mysql_ret = mysql_stmt_attr_set(stmt_2,STMT_ATTR_CURSOR_TYPE,(const void *) &select_cursor); assert(mysql_ret==0); stmt_text = "SELECT a0.t_projno,a0.t_projname,a0.t_deptno,a0.t_respemp,a0.t_prstaff,a0.t_prstdate,a0.t_majproj,a0.t_descript_1,a0.t_descript_2,a0.t_prendate,0 FROM tdbtst160000 a0 "; mysql_ret = mysql_stmt_prepare(stmt_2,stmt_text,strlen(stmt_text)); assert(mysql_ret==0); count = mysql_stmt_param_count(stmt_2); assert( count==0 ); MYSQL_BIND *output_2 = (MYSQL_BIND *)calloc(11, sizeof(MYSQL_BIND)); char data_7[6]; unsigned long len_7; my_bool null_7; set_bind_attrs(&output_2[0],MYSQL_TYPE_VAR_STRING,&data_7,6,&len_7,&null_7); char data_8[20]; unsigned long len_8; my_bool null_8; set_bind_attrs(&output_2[1],MYSQL_TYPE_VAR_STRING,&data_8,20,&len_8,&null_8); char data_9[6]; unsigned long len_9; my_bool null_9; set_bind_attrs(&output_2[2],MYSQL_TYPE_VAR_STRING,&data_9,6,&len_9,&null_9); char data_10[4]; unsigned long len_10; my_bool null_10; set_bind_attrs(&output_2[3],MYSQL_TYPE_LONG,&data_10,4,&len_10,&null_10); char data_11[4]; unsigned long len_11; my_bool null_11; set_bind_attrs(&output_2[4],MYSQL_TYPE_FLOAT,&data_11,4,&len_11,&null_11); char data_12[sizeof(MYSQL_TIME)]; unsigned long len_12; my_bool null_12; set_bind_attrs(&output_2[5],MYSQL_TYPE_DATE,&data_12,36,&len_12,&null_12); char data_13[6]; unsigned long len_13; my_bool null_13; set_bind_attrs(&output_2[6],MYSQL_TYPE_VAR_STRING,&data_13,6,&len_13,&null_13); char data_14[255]; unsigned long len_14; my_bool null_14; set_bind_attrs(&output_2[7],MYSQL_TYPE_VAR_STRING,&data_14,255,&len_14,&null_14); char data_15[51]; unsigned long len_15; my_bool null_15; set_bind_attrs(&output_2[8],MYSQL_TYPE_VAR_STRING,&data_15,51,&len_15,&null_15); char data_16[sizeof(MYSQL_TIME)]; unsigned long len_16; my_bool null_16; set_bind_attrs(&output_2[9],MYSQL_TYPE_DATE,&data_16,36,&len_16,&null_16); char data_17[4]; unsigned long len_17; my_bool null_17; set_bind_attrs(&output_2[10],MYSQL_TYPE_LONG,&data_17,4,&len_17,&null_17); count = mysql_warning_count(sess_1); assert(count==0); mysql_ret = mysql_stmt_execute(stmt_2); assert(mysql_ret==0); count = mysql_warning_count(sess_1); assert(count==0); mysql_stmt_bind_result(stmt_2,output_2); count = mysql_warning_count(sess_1); assert(count==0); mysql_ret = mysql_stmt_fetch(stmt_2); assert(mysql_ret==0); count = mysql_warning_count(sess_1); assert(count==0); ASSERT_EQ(len_7,6); ASSERT_EQ(data_7,"AD3100"); ASSERT_EQ(len_8,20); ASSERT_EQ(data_8,"ADMIN SERVICES "); ASSERT_EQ(len_9,6); ASSERT_EQ(data_9,"D01 "); ASSERT_EQ(data_10,10); ASSERT_EQ(data_11,(float)6.500000); ASSERT_EQ_DATETIME(data_12, 1982,1,1,0,0,0); ASSERT_EQ(len_13,6); ASSERT_EQ(data_13," "); ASSERT_EQ(len_14,252); ASSERT_EQ(data_14,"fortune: memory fault - core dumped/* ----- this line is not intended to be a comment ----- *//* @(#) Version Maybe-2.Probably-03 (I think) */Bugs travel faster than BshellMessage of the President of this company: you are out of workSysV68: PANIC LEVEL"); ASSERT_EQ(len_15,48); ASSERT_EQ(data_15," 1 - bailing outNo dough - no diceExcuse from a "); ASSERT_EQ_DATETIME(data_16, 1983,2,1,0,0,0); ASSERT_EQ(data_17,0); count = mysql_warning_count(sess_1); assert(count==0); mysql_ret = mysql_stmt_free_result(stmt_2); assert(mysql_ret==0); mysql_ret = mysql_stmt_reset(stmt_2); assert(mysql_ret==0); count = mysql_warning_count(sess_1); assert(count==0); // ERROR: next mysql_stmt_fetch call returns corrupt data mysql_ret = mysql_stmt_fetch(stmt_1); assert(mysql_ret==0); count = mysql_warning_count(sess_1); assert(count==0); ASSERT_EQ(len_1,0); ASSERT_EQ(data_1,""); ASSERT_EQ(data_2,860111110); mysql_ret = mysql_stmt_free_result(stmt_1); assert(mysql_ret==0); mysql_ret = mysql_stmt_reset(stmt_1); assert(mysql_ret==0); mysql_ret = mysql_stmt_close(stmt_1); assert(mysql_ret==0); mysql_ret = mysql_stmt_close(stmt_2); assert(mysql_ret==0); mysql_ret = mysql_rollback(sess_1); assert(mysql_ret==0); mysql_close(sess_1); // ****** End of trace ****** } // Following code creates all tables needed to run this trace void create_dbtst160000( void ) { FILE *fp = fopen("/tmp/baan_table_dump","w"); fprintf(fp,"%s\n","-- MySQL dump 10.10"); fprintf(fp,"%s\n","--"); fprintf(fp,"%s\n","-- Host: localhost Database: baan"); fprintf(fp,"%s\n","-- ------------------------------------------------------"); fprintf(fp,"%s\n","-- Server version\0115.0.10-beta-nightly-20050712-debug"); fprintf(fp,"%s\n",""); fprintf(fp,"%s\n","/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;"); fprintf(fp,"%s\n","/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;"); fprintf(fp,"%s\n","/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;"); fprintf(fp,"%s\n","/*!40101 SET NAMES utf8 */;"); fprintf(fp,"%s\n","/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;"); fprintf(fp,"%s\n","/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;"); fprintf(fp,"%s\n","/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;"); fprintf(fp,"%s\n","/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;"); fprintf(fp,"%s\n",""); fprintf(fp,"%s\n","--"); fprintf(fp,"%s\n","-- Table structure for table `tdbtst160000`"); fprintf(fp,"%s\n","--"); fprintf(fp,"%s\n",""); fprintf(fp,"%s\n","DROP TABLE IF EXISTS `tdbtst160000`;"); fprintf(fp,"%s\n","CREATE TABLE `tdbtst160000` ("); fprintf(fp,"%s\n"," `t_projno` varchar(6) collate latin1_bin NOT NULL,"); fprintf(fp,"%s\n"," `t_projname` varchar(20) collate latin1_bin NOT NULL,"); fprintf(fp,"%s\n"," `t_deptno` varchar(6) collate latin1_bin NOT NULL,"); fprintf(fp,"%s\n"," `t_respemp` int(11) NOT NULL,"); fprintf(fp,"%s\n"," `t_prstaff` float NOT NULL,"); fprintf(fp,"%s\n"," `t_prstdate` date NOT NULL,"); fprintf(fp,"%s\n"," `t_majproj` varchar(6) collate latin1_bin NOT NULL,"); fprintf(fp,"%s\n"," `t_descript_1` varchar(255) collate latin1_bin NOT NULL,"); fprintf(fp,"%s\n"," `t_descript_2` varchar(51) collate latin1_bin NOT NULL,"); fprintf(fp,"%s\n"," `t_prendate` date NOT NULL,"); fprintf(fp,"%s\n"," `t_Refcntd` int(11) NOT NULL,"); fprintf(fp,"%s\n"," `t_Refcntu` int(11) NOT NULL,"); fprintf(fp,"%s\n"," PRIMARY KEY (`t_projno`)"); fprintf(fp,"%s\n",") ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin;"); fprintf(fp,"%s\n",""); fprintf(fp,"%s\n","--"); fprintf(fp,"%s\n","-- Dumping data for table `tdbtst160000`"); fprintf(fp,"%s\n","--"); fprintf(fp,"%s\n",""); fprintf(fp,"%s\n",""); fprintf(fp,"%s\n","/*!40000 ALTER TABLE `tdbtst160000` DISABLE KEYS */;"); fprintf(fp,"%s\n","LOCK TABLES `tdbtst160000` WRITE;"); fprintf(fp,"%s\n","INSERT INTO `tdbtst160000` VALUES ('AD3100','ADMIN SERVICES ','D01 ',10,6.5,'1982-01-01',' ','fortune: memory fault - core dumped/* ----- this line is not intended to be a comment ----- *//* @(#) Version Maybe-2.Probably-03 (I think) */Bugs travel faster than BshellMessage of the President of this company: you are out of workSysV68: PANIC LEVEL',' 1 - bailing outNo dough - no diceExcuse from a ','1983-02-01',0,0),('AD3110','GENERAL ADMIN SYSTEM','D21 ',70,6,'1982-01-01','AD3100','Would you like to have a nice burger? Sorry, no time for it right now!Are you sure you can handle this neat piece of hardware?Message from root: all your files have been deleted.Workaholics do it unpaid...Maximum (1) number of users already logged on !','nTry again later, or obtain a larger users licen','1983-02-01',0,0),('AD3111','PAYROLL PROGRAMMING ','D21 ',230,2,'1982-01-01','AD3110','Somebody just hit your carUNIX is a virus from outerspaceALLEEN VOOR BESCHUIT KOM IK ER UIT !Hey man! Do you know where ROUTE 66 is?Yum yum, another piece of GINGER!Ga vandaag maar eens om vijf uur naar huis!Quiet day today, isn\\'t it?Heb je ook zo\\'n zi','n in een Barnies\\' Burger?This line is intended e','1983-02-01',0,0),('AD3112','PERSONNEL PROGRAMMIN','D21 ',250,1,'1982-01-01','AD3110','Please don\\'t hurt meAre you that user who deleted my kernal yesterday ?Weet je al dat je morgen gaat verhuizen?WAT ZIJN DIE DENEN STIL! - WAT ZIJN DIE DENEN STIL - WAT ZIJN DIE DENEN STIL -wat zijn die denen stil - wat zijn die denen stil wat zijn die ','...(3-2)If you\\'re not a part of the solution the','1983-02-01',0,0),('AD3113','ACCOUNT PROGRAMMING ','D21 ',270,2,'1982-01-01','AD3110','Is dit beleid of is er echt over nagedacht?Some of my best friends are computer-service engineers,nbut I don\\'t go off and get drunk with them!Windows sucks dead bunnies through a straw##\011Oud hollandse gedichten# LAURENS BAKE ',' 1629-1702 OP HET ZIEN VAN EEN TA','1983-02-01',0,0),('IF1000','QUERY SERVICES ','C01 ',30,2,'1982-01-01',' ','Wat toont ons dit vermaak, verdwynende in de lucht?Een schets en zweemsel van ons leven, \\'t welk steeds vlucht.En heen vaart als een damp, uit kley zoo broos als glas,o Enkel niet, eerst rook, en uitgerookt maar as. JOAN. BLASIUS ',' 1639-1672 OP ROSETTAAS','1983-02-01',0,0),('IF2000','USER EDUCATION ','C01 ',30,1,'1982-01-01',' ',' Ego nunc me denique natum Gratulor\011\011Eleanor Rigby\011\011\011Sits at the keyboard\011\011\011And waits for a line on the screen\011\011Lives in a dream\011\011Waits for a signal\011\011\011Finding some code\011\011\011That will make the machine do some more.\011\011What is it for?\011\011All the lonely u','sers, where do they all come from?\011\011All the lone','1983-02-01',0,0),('MA2100','WELD LINE AUTOMATION','D01 ',10,12,'1982-01-01',' ','C Code. C Code Run. Run, Code, RUN! \011\011PLEASE!!!!After a long period of deep thoughts about your behaviour in generalnand your drinking habits in particular, we think we do best to recommend younas the first client of our Companies\\' Non-alcoholics Tra','ining-center.\\\"Any fool can paint a picture, but ','1983-02-01',0,0),('MA2110','W L PROGRAMMING ','D11 ',60,9,'1982-01-01','MA2100','\\\"Don\\'t tell me what you dream\\'d last night for I\\'ve been reading Freud.\\\"\\\"Every creature has within him the wild, uncontrollable urge to PUNT.\\\"\\\"He is considered the most graceful speaker who can say nothing in most words.\\\"\\\"MAC user\\'s dynamic debugging l','ist evaluator? Never heard of that.\\\"\\\"Mate, this ','1983-02-01',0,0),('MA2111','W L PROGRAM DESIGN ','D11 ',220,2,'1982-01-01','MA2110','\\\"Mind your own business, Spock. I\\'m sick of your halfbreed interference.\\\"\\\"Oh, Aunty Em, it\\'s so good to be home!\\\"\\\"They took some of the Van Goghs, most of the jewels, and all of the Chivas!\\\"\\\"Toto, I have a feeling we\\'re not in Kansas anymore!\\\"\\'Home, S','weet Home\\' must surely have been written by a ba','1982-12-01',0,0),('MA2112','W L ROBOT DESIGN ','D11 ',150,3,'1982-01-01','MA2110','* XENIX is a Tradeproblem of Some Laboratories./usr/news/gotcha1 bulls, 3 cows.10.0 times 0.1 is hardly ever 1.0.23. ... r-q1: is not an identifierToo bad you logged in on an self-destructive whats-its-name?, for WE don\\'t support none of them machines','A Puritan is someone who is deathly afraid that ','1982-12-01',0,0),('MA2113','W L PROD CONT PROGS ','D11 ',160,3,'1982-02-15','MA2110','A conservative is one who is too cowardly to fight and too fat to run.A foolish consistency is the hobgoblin of little minds.A gift of flower will soon be made to you.A good memory does not equal pale ink.A hammer sometimes misses its mark - a bouquet ','neverA handful of friends is worth more than a w','1982-12-01',0,0),('OP1000','OPERATION SUPPORT ','E01 ',50,6,'1982-01-01',' ','A journey of a thousand miles begins with a cash advance from Jack.A king\\'s castle is his home.A lack of leadership is no substitute for inaction.A liberal is someone too poor to be a capitalist and too rich to be a communist.A man forgives only when h','e is in the wrong.A man paints with his brains a','1983-02-01',0,0),('OP1010','OPERATION ','E11 ',90,5,'1982-01-01','OP1000','A man who turns green has eschewed protein.A plucked goose doesn\\'t lay golden eggs.A professor is one who talks in someone else\\'s sleep.A soft drink turneth away company.A truly wise man never plays leapfrog with a Unicorn.A visit to a fresh place will',' bring strange work.A visit to a strange place w','1983-02-01',0,0),('OP2000','GEN SYSTEMS SERVICES','E01 ',50,5,'1982-01-01',' ','About all some men accomplish in life is to send a son to Harvard.About the only thing on a farm that has an easy time is the dog.Above all things, reverence yourself.Academy: A modern school where football is taught.Actors will happen in the best-regu','lated families.Admiration: Our polite recognitio','1983-02-01',0,0),('OP2010','SYSTEMS SUPPORT ','E21 ',100,4,'1982-01-01','OP2000','Alimony and bribes will engage a large share of your wealth.All great ideas are controversial, or have been at one time.All in all it\\'s just another brick in the wall...All that glitters has a high refractive index.America\\'s best buy for a nickel is a ','telephone call to the right man.An idle mind is ','1983-02-01',0,0),('OP2011','SCP SYSTEMS SUPPORT ','E21 ',320,1,'1982-01-01','OP2010','Anybody can win, unless there happens to be a second entry.As goatherd learns his trade by goat, so writer learns his trade by wrote.As long as the answer is right, who cares if the question is wrong?As of next week, passwords will be entered in Morse ','code.Auribus teneo lupum. (I hold a wolf by the','1983-02-01',0,0),('OP2012','APPLICATIONS SUPPORT','E21 ',330,1,'1982-01-01','OP2010','Avoid temporary variables.Avoid the Fortran arithmetic IF.Avoid unnecessary branches.Baby... -- The Late Elvis Presley.Be careful when a loop exits to the same place from side and bottom.Be careful! Is it classified?Be security conscious - Nat','ional defense is at stake.Been Transferred Latel','1983-02-01',0,0),('OP2013','DB/DC SUPPORT ','E21 ',340,1,'1982-01-01','OP2010','Beware of a dark-haired man with a loud tie.Beware of a tall dark man with a spoon up his nose.Beware of all enterprises that require new clothes.Beware the new TTY code!Biggest security gap - an open mouth.Blessed are they that run around in circles, ','for they shall be known as wheels.Brain fried --','1983-02-01',0,0),('PL2100','WELD LINE PLANNING ','B01 ',20,1,'1982-01-01','MA2100','By failing to prepare, you are preparing to fail.Can anyone remember when the times were not hard, and money not scarce?Can anything be sadder than work left unfinished? Yes, work never begun.Cannot fork -- try again.Change your thoughts and you chang','e your world.Charity: a thing that begins at ho','1982-09-15',0,0);"); fprintf(fp,"%s\n","UNLOCK TABLES;"); fprintf(fp,"%s\n","/*!40000 ALTER TABLE `tdbtst160000` ENABLE KEYS */;"); fprintf(fp,"%s\n",""); fprintf(fp,"%s\n","/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;"); fprintf(fp,"%s\n","/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;"); fprintf(fp,"%s\n","/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;"); fprintf(fp,"%s\n","/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;"); fprintf(fp,"%s\n","/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;"); fprintf(fp,"%s\n","/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;"); fprintf(fp,"%s\n","/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;"); fprintf(fp,"%s\n",""); fclose(fp); std::string cmd = std::string("mysql"); if ( OWNER_NAME ) cmd += std::string(" --user=") + OWNER_NAME; if ( OWNER_PWD ) cmd += std::string(" --password=") + OWNER_PWD; if ( HOST_NAME ) cmd += std::string(" --host=") + HOST_NAME; if ( UNIX_SOCKET ) cmd += std::string(" --socket=") + UNIX_SOCKET; cmd += std::string(" ") + DB_NAME; cmd += " < /tmp/baan_table_dump"; int ret = system(cmd.data()); if ( ret != 0 ) fprintf(stderr,"Command \"%s\" failed\n",cmd.data()); } void create_tables( void ) { create_dbtst160000(); } #if 0 // Output of "show variables" # # Variable_name Value # auto_increment_increment 1 # auto_increment_offset 1 # automatic_sp_privileges ON # back_log 50 # basedir /usr1/mysql/mysql-5.0.10-beta-nightly-20050712-linux-i686/ # binlog_cache_size 32768 # bulk_insert_buffer_size 8388608 # character_set_client latin1 # character_set_connection latin1 # character_set_database latin1 # character_set_results latin1 # character_set_server latin1 # character_set_system utf8 # character_sets_dir /usr1/mysql/mysql-5.0.10-beta-nightly-20050712-linux-i686/share/mysql/charsets/ # collation_connection latin1_swedish_ci # collation_database latin1_swedish_ci # collation_server latin1_swedish_ci # completion_type 0 # concurrent_insert 1 # connect_timeout 5 # datadir /usr1/mysql/mysql-5.0.10-beta-nightly-20050712-linux-i686/data/ # date_format %Y-%m-%d # datetime_format %Y-%m-%d %H:%i:%s # div_precision_increment 4 # default_week_format 0 # delay_key_write ON # delayed_insert_limit 100 # delayed_insert_timeout 300 # delayed_queue_size 1000 # expire_logs_days 0 # flush OFF # flush_time 0 # ft_boolean_syntax + -><()~*:""&| # ft_max_word_len 84 # ft_min_word_len 4 # ft_query_expansion_limit 20 # ft_stopword_file (built-in) # group_concat_max_len 1024 # have_archive NO # have_bdb NO # have_blackhole_engine NO # have_compress YES # have_crypt YES # have_csv NO # have_example_engine NO # have_federated_engine NO # have_geometry YES # have_innodb YES # have_isam NO # have_ndbcluster NO # have_openssl NO # have_query_cache YES # have_raid NO # have_rtree_keys YES # have_symlink YES # init_connect # init_file # init_slave # innodb_additional_mem_pool_size 1048576 # innodb_autoextend_increment 8 # innodb_buffer_pool_awe_mem_mb 0 # innodb_buffer_pool_size 8388608 # innodb_checksums ON # innodb_concurrency_tickets 500 # innodb_data_file_path ibdata1:10M:autoextend # innodb_data_home_dir # innodb_doublewrite ON # innodb_fast_shutdown 1 # innodb_file_io_threads 4 # innodb_file_per_table OFF # innodb_flush_log_at_trx_commit 1 # innodb_flush_method # innodb_force_recovery 0 # innodb_lock_wait_timeout 10 # innodb_locks_unsafe_for_binlog OFF # innodb_log_arch_dir # innodb_log_archive OFF # innodb_log_buffer_size 1048576 # innodb_log_file_size 5242880 # innodb_log_files_in_group 2 # innodb_log_group_home_dir ./ # innodb_max_dirty_pages_pct 90 # innodb_max_purge_lag 0 # innodb_mirrored_log_groups 1 # innodb_open_files 300 # innodb_sync_spin_loops 20 # innodb_table_locks ON # innodb_support_xa ON # innodb_thread_concurrency 20 # innodb_thread_sleep_delay 10000 # interactive_timeout 28800 # join_buffer_size 131072 # key_buffer_size 16777216 # key_cache_age_threshold 300 # key_cache_block_size 1024 # key_cache_division_limit 100 # language /usr1/mysql/mysql-5.0.10-beta-nightly-20050712-linux-i686/share/mysql/english/ # large_files_support ON # large_pages OFF # large_page_size 0 # license GPL # local_infile ON # locked_in_memory OFF # log OFF # log_bin OFF # log_bin_trust_routine_creators OFF # log_error # log_slave_updates OFF # log_slow_queries OFF # log_warnings 1 # long_query_time 10 # low_priority_updates OFF # lower_case_file_system OFF # lower_case_table_names 0 # max_allowed_packet 1047552 # max_binlog_cache_size 4294967295 # max_binlog_size 1073741824 # max_connect_errors 10 # max_connections 100 # max_delayed_threads 20 # max_error_count 64 # max_heap_table_size 16777216 # max_insert_delayed_threads 20 # max_join_size 4294967295 # max_length_for_sort_data 1024 # max_relay_log_size 0 # max_seeks_for_key 4294967295 # max_sort_length 1024 # max_tmp_tables 32 # max_user_connections 0 # max_write_lock_count 4294967295 # multi_range_count 256 # myisam_data_pointer_size 6 # myisam_max_sort_file_size 2147483647 # myisam_recover_options OFF # myisam_repair_threads 1 # myisam_sort_buffer_size 8388608 # engine_condition_pushdown OFF # net_buffer_length 8192 # net_read_timeout 30 # net_retry_count 10 # net_write_timeout 60 # new OFF # old_passwords OFF # open_files_limit 1024 # optimizer_prune_level 1 # optimizer_search_depth 62 # pid_file /usr1/mysql/mysql-5.0.10-beta-nightly-20050712-linux-i686/data/nlbaldev1.pid # port 3306 # preload_buffer_size 32768 # protocol_version 10 # query_alloc_block_size 8192 # query_cache_limit 1048576 # query_cache_min_res_unit 4096 # query_cache_size 0 # query_cache_type ON # query_cache_wlock_invalidate OFF # query_prealloc_size 8192 # range_alloc_block_size 2048 # read_buffer_size 131072 # read_only OFF # read_rnd_buffer_size 262144 # relay_log_purge ON # relay_log_space_limit 0 # rpl_recovery_rank 0 # secure_auth OFF # server_id 1 # skip_external_locking ON # skip_networking OFF # skip_show_database OFF # slave_compressed_protocol OFF # slave_load_tmpdir /tmp/ # slave_net_timeout 3600 # slave_skip_errors OFF # slave_transaction_retries 10 # slow_launch_time 2 # socket /var/lib/mysql/mysql.sock # sort_buffer_size 524252 # sql_mode # storage_engine MyISAM # sql_notes ON # sql_warnings ON # sync_binlog 0 # sync_replication 0 # sync_replication_slave_id 0 # sync_replication_timeout 10 # sync_frm ON # system_time_zone CEST # table_cache 64 # table_type MyISAM # thread_cache_size 0 # thread_stack 196608 # time_format %H:%i:%s # time_zone SYSTEM # timed_mutexes OFF # tmp_table_size 33554432 # tmpdir # transaction_alloc_block_size 8192 # transaction_prealloc_size 4096 # tx_isolation REPEATABLE-READ # updatable_views_with_limit YES # version 5.0.10-beta-nightly-20050712-debug # version_comment Source distribution # version_compile_machine i686 # version_compile_os pc-linux-gnu # wait_timeout 28800 # #endif // Output of "show variables"