// 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/baan123, who has SELECT, INSERT, UPDATE, DELETE // privileges on all objects and baan/baan123 (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 #include #include #include // Connection parameters const char *MYSQL_CMD = "mysql"; // Used for table creation 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 M_EXPECT_EQUALS (void)" to disable data validation typedef enum { STR, SESS, STMT } ; #define M_EXPECT_EQUALS(X,Y,T,V) if ( X==Y ); else { \ cout << "!!! Error (" << __LINE__ << "): " << endl \ << " Expected value:" << X << endl \ << " Returned value:" << Y << endl; \ switch (T) { \ case STR : cout << " error: " << (const char *)V << endl; break;\ case SESS: cout << " mysql error: " << mysql_error((MYSQL*)V) << endl; break;\ case STMT: cout << " mysql error: " << mysql_stmt_error((MYSQL_STMT*)V) << endl; break;\ } \ assert( 0 ); \ } \ #include "mysql.h" using namespace std; const char *enum_str[7] = {"Nul","Int","Flt","Dbl","Str","Raw","Dtm"}; class Value { public: typedef enum { Nul , Int , Flt , Dbl , Str , Raw , Dtm } Type; Value( string S, Type T ) { _str = S; _type = T; } int Equals( const Value &V ) const { return _type == V._type && _str == V._str; } void toStream( ostream& s ) const { s << "[" << enum_str[_type] << "]\"" << _str << "\""; } private: string _str; Type _type; }; ostream& operator<< (ostream& s,const Value& v) { v.toStream(s); return s; } class ValueList { public: ValueList operator + (const ValueList& other) const { ValueList newList; list::const_iterator i; for ( i = this->_vals.begin(); i != this->_vals.end(); i++ ) newList._vals.push_back(*i); for ( i = other._vals.begin(); i != other._vals.end(); i++ ) newList._vals.push_back(*i); return newList; } void operator += (const ValueList& other) { list::const_iterator i; for ( i = other._vals.begin(); i != other._vals.end(); i++ ) _vals.push_back(*i); } int operator == ( const ValueList& Other ) const { list::const_iterator i1 = _vals.begin(); list::const_iterator i2 = Other._vals.begin(); while ( i1 != _vals.end() && i2 != Other._vals.end() && i1->Equals(*i2) ) i1++, i2++; return i1 == _vals.end() && i2 == Other._vals.end(); } void toStream( ostream &s ) const { list::const_iterator i; for ( i = _vals.begin(); i != _vals.end(); i++ ) { if ( i != _vals.begin() ) s << ","; s << *i; } } protected: list _vals; }; ostream& operator<< (ostream &s,const ValueList&vl) { vl.toStream(s); return s; } class Null : public ValueList { // The NULL value public: Null(void) { _vals.push_back(Value("",Value::Nul)); } }; class I : public ValueList { // An integer value public: I(int I) { ostringstream s; s << I; _vals.push_back(Value(s.str(),Value::Int)); } }; class F : public ValueList { // A float value public: F(double D) { char str[40]; sprintf(str,"%.7g",D); _vals.push_back(Value(string(str),Value::Flt)); } }; class D : public ValueList { // A double value public: D(double D) { char str[40]; sprintf(str,"%.15lg",D); _vals.push_back(Value(string(str),Value::Dbl)); } }; class S : public ValueList { // A string value public: S(string S) { _vals.push_back(Value(S,Value::Str)); } S(const char *S, int len) { int i; string s; for ( i=0; iis_null ) { l += Null(); } else switch ( mysql_bind->buffer_type ) { case MYSQL_TYPE_LONG: l += I(*((int*)(mysql_bind->buffer))); break; case MYSQL_TYPE_FLOAT: l += F(*((float*)(mysql_bind->buffer))); break; case MYSQL_TYPE_DOUBLE: l += D(*((double*)(mysql_bind->buffer))); break; case MYSQL_TYPE_VAR_STRING: l += S((char*)mysql_bind->buffer,*mysql_bind->length); break; case MYSQL_TYPE_DATE: case MYSQL_TYPE_DATETIME: { MYSQL_TIME *t = (MYSQL_TIME*)mysql_bind->buffer; l += T(t->year,t->month,t->day,t->hour,t->minute,t->second); } break; default: assert( 0 ); // Error or type to be implemented } } return l; } void create_tables(void); // Global variables const char *m_text; int m_ret; int m_count; int m_err; MYSQL_RES *m_result; MYSQL_ROW m_row; ValueList m_expect; 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 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); m_ret = mysql_stmt_attr_set(stmt_1,STMT_ATTR_CURSOR_TYPE,(const void *) &select_cursor); M_EXPECT_EQUALS(0,m_ret,STMT,stmt_1); m_text = "SELECT a0.t_slcp,a0.t_ortp,a0.t_koor,a0.t_slso,a0.t_oset,a0.t_pono,a0.t_sqnb,a0.t_shpm,a0.t_scmp,a0.t_sfcp,a0.t_bona,a0.t_boid,a0.t_borf,a0.t_guid,a0.t_abna,a0.t_abid,a0.t_abrf,a0.t_agui,a0.t_ityp,a0.t_idoc,a0.t_invt,a0.t_cprj,a0.t_cwar,a0.t_stbp,a0.t_sfra,a0.t_stoa,a0.t_styp,a0.t_setn,a0.t_codt,a0.t_ddat,a0.t_stat,a0.t_coiv,a0.t_item,a0.t_desc,a0.t_rate_1,a0.t_rate_2,a0.t_rate_3,a0.t_ratf_1,a0.t_ratf_2,a0.t_ratf_3,a0.t_ratd,a0.t_rtyp,a0.t_pric,a0.t_amti,a0.t_amth_1,a0.t_amth_2,a0.t_amth_3,a0.t_dqua,a0.t_oqua,a0.t_txai,a0.t_txah_1,a0.t_txah_2,a0.t_txah_3,a0.t_txct,a0.t_txid,a0.t_dism_1,a0.t_dism_2,a0.t_dism_3,a0.t_dism_4,a0.t_dism_5,a0.t_dism_6,a0.t_dism_7,a0.t_dism_8,a0.t_dism_9,a0.t_dism_10,a0.t_dism_11,a0.t_disc_1,a0.t_disc_2,a0.t_disc_3,a0.t_disc_4,a0.t_disc_5,a0.t_disc_6,a0.t_disc_7,a0.t_disc_8,a0.t_disc_9,a0.t_disc_10,a0.t_disc_11,a0.t_ldam_1,a0.t_ldam_2,a0.t_ldam_3,a0.t_ldam_4,a0.t_ldam_5,a0.t_ldam_6,a0.t_ldam_7,a0.t_ldam_8,a0.t_ldam_9,a0.t_ldam_10,a0.t_ldam_11,a0.t_ldai,a0.t_odai,a0.t_cups,a0.t_cvps,a0.t_cuqs,a0.t_cvqs,a0.t_cpva,a0.t_cogn_1,a0.t_cogn_2,a0.t_cogn_3,a0.t_copr_1,a0.t_copr_2,a0.t_copr_3,a0.t_chtp,a0.t_revi,a0.t_corn,a0.t_corp,a0.t_ceno,a0.t_cors,a0.t_rcod,a0.t_cofc,a0.t_dgid,a0.t_itxt,a0.t_ltxt,a0.t_dtxt,90 FROM tcisli245090 a0 WHERE (a0.t_slcp >= ?) ORDER BY 1,2,3,4,5,6,7,8"; m_ret = mysql_stmt_prepare(stmt_1,m_text,strlen(m_text)); M_EXPECT_EQUALS(0,m_ret,STMT,stmt_1); m_count = mysql_stmt_param_count(stmt_1); M_EXPECT_EQUALS( 1, m_count, 0, NULL ); MYSQL_BIND *param_1 = (MYSQL_BIND *)calloc(1, sizeof(MYSQL_BIND)); MYSQL_BIND *output_1 = (MYSQL_BIND *)calloc(114, sizeof(MYSQL_BIND)); char data_1[4]; unsigned long len_1; my_bool null_1; set_bind_attrs(¶m_1[0],MYSQL_TYPE_LONG,&data_1,4,&len_1,&null_1); char data_2[4]; unsigned long len_2; my_bool null_2; set_bind_attrs(&output_1[0],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[1],MYSQL_TYPE_LONG,&data_3,4,&len_3,&null_3); char data_4[4]; unsigned long len_4; my_bool null_4; set_bind_attrs(&output_1[2],MYSQL_TYPE_LONG,&data_4,4,&len_4,&null_4); char data_5[9]; unsigned long len_5; my_bool null_5; set_bind_attrs(&output_1[3],MYSQL_TYPE_VAR_STRING,&data_5,9,&len_5,&null_5); char data_6[4]; unsigned long len_6; my_bool null_6; set_bind_attrs(&output_1[4],MYSQL_TYPE_LONG,&data_6,4,&len_6,&null_6); char data_7[4]; unsigned long len_7; my_bool null_7; set_bind_attrs(&output_1[5],MYSQL_TYPE_LONG,&data_7,4,&len_7,&null_7); char data_8[4]; unsigned long len_8; my_bool null_8; set_bind_attrs(&output_1[6],MYSQL_TYPE_LONG,&data_8,4,&len_8,&null_8); char data_9[9]; unsigned long len_9; my_bool null_9; set_bind_attrs(&output_1[7],MYSQL_TYPE_VAR_STRING,&data_9,9,&len_9,&null_9); char data_10[4]; unsigned long len_10; my_bool null_10; set_bind_attrs(&output_1[8],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_1[9],MYSQL_TYPE_LONG,&data_11,4,&len_11,&null_11); char data_12[17]; unsigned long len_12; my_bool null_12; set_bind_attrs(&output_1[10],MYSQL_TYPE_VAR_STRING,&data_12,17,&len_12,&null_12); char data_13[9]; unsigned long len_13; my_bool null_13; set_bind_attrs(&output_1[11],MYSQL_TYPE_VAR_STRING,&data_13,9,&len_13,&null_13); char data_14[40]; unsigned long len_14; my_bool null_14; set_bind_attrs(&output_1[12],MYSQL_TYPE_VAR_STRING,&data_14,40,&len_14,&null_14); char data_15[22]; unsigned long len_15; my_bool null_15; set_bind_attrs(&output_1[13],MYSQL_TYPE_VAR_STRING,&data_15,22,&len_15,&null_15); char data_16[17]; unsigned long len_16; my_bool null_16; set_bind_attrs(&output_1[14],MYSQL_TYPE_VAR_STRING,&data_16,17,&len_16,&null_16); char data_17[9]; unsigned long len_17; my_bool null_17; set_bind_attrs(&output_1[15],MYSQL_TYPE_VAR_STRING,&data_17,9,&len_17,&null_17); char data_18[40]; unsigned long len_18; my_bool null_18; set_bind_attrs(&output_1[16],MYSQL_TYPE_VAR_STRING,&data_18,40,&len_18,&null_18); char data_19[22]; unsigned long len_19; my_bool null_19; set_bind_attrs(&output_1[17],MYSQL_TYPE_VAR_STRING,&data_19,22,&len_19,&null_19); char data_20[3]; unsigned long len_20; my_bool null_20; set_bind_attrs(&output_1[18],MYSQL_TYPE_VAR_STRING,&data_20,3,&len_20,&null_20); char data_21[4]; unsigned long len_21; my_bool null_21; set_bind_attrs(&output_1[19],MYSQL_TYPE_LONG,&data_21,4,&len_21,&null_21); char data_22[4]; unsigned long len_22; my_bool null_22; set_bind_attrs(&output_1[20],MYSQL_TYPE_LONG,&data_22,4,&len_22,&null_22); char data_23[9]; unsigned long len_23; my_bool null_23; set_bind_attrs(&output_1[21],MYSQL_TYPE_VAR_STRING,&data_23,9,&len_23,&null_23); char data_24[6]; unsigned long len_24; my_bool null_24; set_bind_attrs(&output_1[22],MYSQL_TYPE_VAR_STRING,&data_24,6,&len_24,&null_24); char data_25[9]; unsigned long len_25; my_bool null_25; set_bind_attrs(&output_1[23],MYSQL_TYPE_VAR_STRING,&data_25,9,&len_25,&null_25); char data_26[9]; unsigned long len_26; my_bool null_26; set_bind_attrs(&output_1[24],MYSQL_TYPE_VAR_STRING,&data_26,9,&len_26,&null_26); char data_27[9]; unsigned long len_27; my_bool null_27; set_bind_attrs(&output_1[25],MYSQL_TYPE_VAR_STRING,&data_27,9,&len_27,&null_27); char data_28[6]; unsigned long len_28; my_bool null_28; set_bind_attrs(&output_1[26],MYSQL_TYPE_VAR_STRING,&data_28,6,&len_28,&null_28); char data_29[4]; unsigned long len_29; my_bool null_29; set_bind_attrs(&output_1[27],MYSQL_TYPE_LONG,&data_29,4,&len_29,&null_29); char data_30[sizeof(MYSQL_TIME)]; unsigned long len_30; my_bool null_30; set_bind_attrs(&output_1[28],MYSQL_TYPE_DATETIME,&data_30,36,&len_30,&null_30); char data_31[sizeof(MYSQL_TIME)]; unsigned long len_31; my_bool null_31; set_bind_attrs(&output_1[29],MYSQL_TYPE_DATETIME,&data_31,36,&len_31,&null_31); char data_32[4]; unsigned long len_32; my_bool null_32; set_bind_attrs(&output_1[30],MYSQL_TYPE_LONG,&data_32,4,&len_32,&null_32); char data_33[4]; unsigned long len_33; my_bool null_33; set_bind_attrs(&output_1[31],MYSQL_TYPE_LONG,&data_33,4,&len_33,&null_33); char data_34[47]; unsigned long len_34; my_bool null_34; set_bind_attrs(&output_1[32],MYSQL_TYPE_VAR_STRING,&data_34,47,&len_34,&null_34); char data_35[50]; unsigned long len_35; my_bool null_35; set_bind_attrs(&output_1[33],MYSQL_TYPE_VAR_STRING,&data_35,50,&len_35,&null_35); char data_36[8]; unsigned long len_36; my_bool null_36; set_bind_attrs(&output_1[34],MYSQL_TYPE_DOUBLE,&data_36,8,&len_36,&null_36); char data_37[8]; unsigned long len_37; my_bool null_37; set_bind_attrs(&output_1[35],MYSQL_TYPE_DOUBLE,&data_37,8,&len_37,&null_37); char data_38[8]; unsigned long len_38; my_bool null_38; set_bind_attrs(&output_1[36],MYSQL_TYPE_DOUBLE,&data_38,8,&len_38,&null_38); char data_39[4]; unsigned long len_39; my_bool null_39; set_bind_attrs(&output_1[37],MYSQL_TYPE_LONG,&data_39,4,&len_39,&null_39); char data_40[4]; unsigned long len_40; my_bool null_40; set_bind_attrs(&output_1[38],MYSQL_TYPE_LONG,&data_40,4,&len_40,&null_40); char data_41[4]; unsigned long len_41; my_bool null_41; set_bind_attrs(&output_1[39],MYSQL_TYPE_LONG,&data_41,4,&len_41,&null_41); char data_42[sizeof(MYSQL_TIME)]; unsigned long len_42; my_bool null_42; set_bind_attrs(&output_1[40],MYSQL_TYPE_DATETIME,&data_42,36,&len_42,&null_42); char data_43[3]; unsigned long len_43; my_bool null_43; set_bind_attrs(&output_1[41],MYSQL_TYPE_VAR_STRING,&data_43,3,&len_43,&null_43); char data_44[8]; unsigned long len_44; my_bool null_44; set_bind_attrs(&output_1[42],MYSQL_TYPE_DOUBLE,&data_44,8,&len_44,&null_44); char data_45[8]; unsigned long len_45; my_bool null_45; set_bind_attrs(&output_1[43],MYSQL_TYPE_DOUBLE,&data_45,8,&len_45,&null_45); char data_46[8]; unsigned long len_46; my_bool null_46; set_bind_attrs(&output_1[44],MYSQL_TYPE_DOUBLE,&data_46,8,&len_46,&null_46); char data_47[8]; unsigned long len_47; my_bool null_47; set_bind_attrs(&output_1[45],MYSQL_TYPE_DOUBLE,&data_47,8,&len_47,&null_47); char data_48[8]; unsigned long len_48; my_bool null_48; set_bind_attrs(&output_1[46],MYSQL_TYPE_DOUBLE,&data_48,8,&len_48,&null_48); char data_49[8]; unsigned long len_49; my_bool null_49; set_bind_attrs(&output_1[47],MYSQL_TYPE_DOUBLE,&data_49,8,&len_49,&null_49); char data_50[8]; unsigned long len_50; my_bool null_50; set_bind_attrs(&output_1[48],MYSQL_TYPE_DOUBLE,&data_50,8,&len_50,&null_50); char data_51[8]; unsigned long len_51; my_bool null_51; set_bind_attrs(&output_1[49],MYSQL_TYPE_DOUBLE,&data_51,8,&len_51,&null_51); char data_52[8]; unsigned long len_52; my_bool null_52; set_bind_attrs(&output_1[50],MYSQL_TYPE_DOUBLE,&data_52,8,&len_52,&null_52); char data_53[8]; unsigned long len_53; my_bool null_53; set_bind_attrs(&output_1[51],MYSQL_TYPE_DOUBLE,&data_53,8,&len_53,&null_53); char data_54[8]; unsigned long len_54; my_bool null_54; set_bind_attrs(&output_1[52],MYSQL_TYPE_DOUBLE,&data_54,8,&len_54,&null_54); char data_55[3]; unsigned long len_55; my_bool null_55; set_bind_attrs(&output_1[53],MYSQL_TYPE_VAR_STRING,&data_55,3,&len_55,&null_55); char data_56[9]; unsigned long len_56; my_bool null_56; set_bind_attrs(&output_1[54],MYSQL_TYPE_VAR_STRING,&data_56,9,&len_56,&null_56); char data_57[4]; unsigned long len_57; my_bool null_57; set_bind_attrs(&output_1[55],MYSQL_TYPE_LONG,&data_57,4,&len_57,&null_57); char data_58[4]; unsigned long len_58; my_bool null_58; set_bind_attrs(&output_1[56],MYSQL_TYPE_LONG,&data_58,4,&len_58,&null_58); char data_59[4]; unsigned long len_59; my_bool null_59; set_bind_attrs(&output_1[57],MYSQL_TYPE_LONG,&data_59,4,&len_59,&null_59); char data_60[4]; unsigned long len_60; my_bool null_60; set_bind_attrs(&output_1[58],MYSQL_TYPE_LONG,&data_60,4,&len_60,&null_60); char data_61[4]; unsigned long len_61; my_bool null_61; set_bind_attrs(&output_1[59],MYSQL_TYPE_LONG,&data_61,4,&len_61,&null_61); char data_62[4]; unsigned long len_62; my_bool null_62; set_bind_attrs(&output_1[60],MYSQL_TYPE_LONG,&data_62,4,&len_62,&null_62); char data_63[4]; unsigned long len_63; my_bool null_63; set_bind_attrs(&output_1[61],MYSQL_TYPE_LONG,&data_63,4,&len_63,&null_63); char data_64[4]; unsigned long len_64; my_bool null_64; set_bind_attrs(&output_1[62],MYSQL_TYPE_LONG,&data_64,4,&len_64,&null_64); char data_65[4]; unsigned long len_65; my_bool null_65; set_bind_attrs(&output_1[63],MYSQL_TYPE_LONG,&data_65,4,&len_65,&null_65); char data_66[4]; unsigned long len_66; my_bool null_66; set_bind_attrs(&output_1[64],MYSQL_TYPE_LONG,&data_66,4,&len_66,&null_66); char data_67[4]; unsigned long len_67; my_bool null_67; set_bind_attrs(&output_1[65],MYSQL_TYPE_LONG,&data_67,4,&len_67,&null_67); char data_68[4]; unsigned long len_68; my_bool null_68; set_bind_attrs(&output_1[66],MYSQL_TYPE_FLOAT,&data_68,4,&len_68,&null_68); char data_69[4]; unsigned long len_69; my_bool null_69; set_bind_attrs(&output_1[67],MYSQL_TYPE_FLOAT,&data_69,4,&len_69,&null_69); char data_70[4]; unsigned long len_70; my_bool null_70; set_bind_attrs(&output_1[68],MYSQL_TYPE_FLOAT,&data_70,4,&len_70,&null_70); char data_71[4]; unsigned long len_71; my_bool null_71; set_bind_attrs(&output_1[69],MYSQL_TYPE_FLOAT,&data_71,4,&len_71,&null_71); char data_72[4]; unsigned long len_72; my_bool null_72; set_bind_attrs(&output_1[70],MYSQL_TYPE_FLOAT,&data_72,4,&len_72,&null_72); char data_73[4]; unsigned long len_73; my_bool null_73; set_bind_attrs(&output_1[71],MYSQL_TYPE_FLOAT,&data_73,4,&len_73,&null_73); char data_74[4]; unsigned long len_74; my_bool null_74; set_bind_attrs(&output_1[72],MYSQL_TYPE_FLOAT,&data_74,4,&len_74,&null_74); char data_75[4]; unsigned long len_75; my_bool null_75; set_bind_attrs(&output_1[73],MYSQL_TYPE_FLOAT,&data_75,4,&len_75,&null_75); char data_76[4]; unsigned long len_76; my_bool null_76; set_bind_attrs(&output_1[74],MYSQL_TYPE_FLOAT,&data_76,4,&len_76,&null_76); char data_77[4]; unsigned long len_77; my_bool null_77; set_bind_attrs(&output_1[75],MYSQL_TYPE_FLOAT,&data_77,4,&len_77,&null_77); char data_78[4]; unsigned long len_78; my_bool null_78; set_bind_attrs(&output_1[76],MYSQL_TYPE_FLOAT,&data_78,4,&len_78,&null_78); char data_79[8]; unsigned long len_79; my_bool null_79; set_bind_attrs(&output_1[77],MYSQL_TYPE_DOUBLE,&data_79,8,&len_79,&null_79); char data_80[8]; unsigned long len_80; my_bool null_80; set_bind_attrs(&output_1[78],MYSQL_TYPE_DOUBLE,&data_80,8,&len_80,&null_80); char data_81[8]; unsigned long len_81; my_bool null_81; set_bind_attrs(&output_1[79],MYSQL_TYPE_DOUBLE,&data_81,8,&len_81,&null_81); char data_82[8]; unsigned long len_82; my_bool null_82; set_bind_attrs(&output_1[80],MYSQL_TYPE_DOUBLE,&data_82,8,&len_82,&null_82); char data_83[8]; unsigned long len_83; my_bool null_83; set_bind_attrs(&output_1[81],MYSQL_TYPE_DOUBLE,&data_83,8,&len_83,&null_83); char data_84[8]; unsigned long len_84; my_bool null_84; set_bind_attrs(&output_1[82],MYSQL_TYPE_DOUBLE,&data_84,8,&len_84,&null_84); char data_85[8]; unsigned long len_85; my_bool null_85; set_bind_attrs(&output_1[83],MYSQL_TYPE_DOUBLE,&data_85,8,&len_85,&null_85); char data_86[8]; unsigned long len_86; my_bool null_86; set_bind_attrs(&output_1[84],MYSQL_TYPE_DOUBLE,&data_86,8,&len_86,&null_86); char data_87[8]; unsigned long len_87; my_bool null_87; set_bind_attrs(&output_1[85],MYSQL_TYPE_DOUBLE,&data_87,8,&len_87,&null_87); char data_88[8]; unsigned long len_88; my_bool null_88; set_bind_attrs(&output_1[86],MYSQL_TYPE_DOUBLE,&data_88,8,&len_88,&null_88); char data_89[8]; unsigned long len_89; my_bool null_89; set_bind_attrs(&output_1[87],MYSQL_TYPE_DOUBLE,&data_89,8,&len_89,&null_89); char data_90[8]; unsigned long len_90; my_bool null_90; set_bind_attrs(&output_1[88],MYSQL_TYPE_DOUBLE,&data_90,8,&len_90,&null_90); char data_91[8]; unsigned long len_91; my_bool null_91; set_bind_attrs(&output_1[89],MYSQL_TYPE_DOUBLE,&data_91,8,&len_91,&null_91); char data_92[3]; unsigned long len_92; my_bool null_92; set_bind_attrs(&output_1[90],MYSQL_TYPE_VAR_STRING,&data_92,3,&len_92,&null_92); char data_93[8]; unsigned long len_93; my_bool null_93; set_bind_attrs(&output_1[91],MYSQL_TYPE_DOUBLE,&data_93,8,&len_93,&null_93); char data_94[3]; unsigned long len_94; my_bool null_94; set_bind_attrs(&output_1[92],MYSQL_TYPE_VAR_STRING,&data_94,3,&len_94,&null_94); char data_95[8]; unsigned long len_95; my_bool null_95; set_bind_attrs(&output_1[93],MYSQL_TYPE_DOUBLE,&data_95,8,&len_95,&null_95); char data_96[4]; unsigned long len_96; my_bool null_96; set_bind_attrs(&output_1[94],MYSQL_TYPE_LONG,&data_96,4,&len_96,&null_96); char data_97[8]; unsigned long len_97; my_bool null_97; set_bind_attrs(&output_1[95],MYSQL_TYPE_DOUBLE,&data_97,8,&len_97,&null_97); char data_98[8]; unsigned long len_98; my_bool null_98; set_bind_attrs(&output_1[96],MYSQL_TYPE_DOUBLE,&data_98,8,&len_98,&null_98); char data_99[8]; unsigned long len_99; my_bool null_99; set_bind_attrs(&output_1[97],MYSQL_TYPE_DOUBLE,&data_99,8,&len_99,&null_99); char data_100[8]; unsigned long len_100; my_bool null_100; set_bind_attrs(&output_1[98],MYSQL_TYPE_DOUBLE,&data_100,8,&len_100,&null_100); char data_101[8]; unsigned long len_101; my_bool null_101; set_bind_attrs(&output_1[99],MYSQL_TYPE_DOUBLE,&data_101,8,&len_101,&null_101); char data_102[8]; unsigned long len_102; my_bool null_102; set_bind_attrs(&output_1[100],MYSQL_TYPE_DOUBLE,&data_102,8,&len_102,&null_102); char data_103[4]; unsigned long len_103; my_bool null_103; set_bind_attrs(&output_1[101],MYSQL_TYPE_LONG,&data_103,4,&len_103,&null_103); char data_104[6]; unsigned long len_104; my_bool null_104; set_bind_attrs(&output_1[102],MYSQL_TYPE_VAR_STRING,&data_104,6,&len_104,&null_104); char data_105[30]; unsigned long len_105; my_bool null_105; set_bind_attrs(&output_1[103],MYSQL_TYPE_VAR_STRING,&data_105,30,&len_105,&null_105); char data_106[16]; unsigned long len_106; my_bool null_106; set_bind_attrs(&output_1[104],MYSQL_TYPE_VAR_STRING,&data_106,16,&len_106,&null_106); char data_107[20]; unsigned long len_107; my_bool null_107; set_bind_attrs(&output_1[105],MYSQL_TYPE_VAR_STRING,&data_107,20,&len_107,&null_107); char data_108[11]; unsigned long len_108; my_bool null_108; set_bind_attrs(&output_1[106],MYSQL_TYPE_VAR_STRING,&data_108,11,&len_108,&null_108); char data_109[6]; unsigned long len_109; my_bool null_109; set_bind_attrs(&output_1[107],MYSQL_TYPE_VAR_STRING,&data_109,6,&len_109,&null_109); char data_110[6]; unsigned long len_110; my_bool null_110; set_bind_attrs(&output_1[108],MYSQL_TYPE_VAR_STRING,&data_110,6,&len_110,&null_110); char data_111[22]; unsigned long len_111; my_bool null_111; set_bind_attrs(&output_1[109],MYSQL_TYPE_VAR_STRING,&data_111,22,&len_111,&null_111); char data_112[4]; unsigned long len_112; my_bool null_112; set_bind_attrs(&output_1[110],MYSQL_TYPE_LONG,&data_112,4,&len_112,&null_112); char data_113[4]; unsigned long len_113; my_bool null_113; set_bind_attrs(&output_1[111],MYSQL_TYPE_LONG,&data_113,4,&len_113,&null_113); char data_114[4]; unsigned long len_114; my_bool null_114; set_bind_attrs(&output_1[112],MYSQL_TYPE_LONG,&data_114,4,&len_114,&null_114); char data_115[4]; unsigned long len_115; my_bool null_115; set_bind_attrs(&output_1[113],MYSQL_TYPE_LONG,&data_115,4,&len_115,&null_115); null_1 = 0; len_1 = 0; *((int*)data_1) = -32768; mysql_stmt_bind_param(stmt_1,param_1); m_count = mysql_warning_count(sess_1); M_EXPECT_EQUALS(0,m_count,0,NULL); m_ret = mysql_stmt_execute(stmt_1); M_EXPECT_EQUALS(0,m_ret,STMT,stmt_1); m_count = mysql_warning_count(sess_1); M_EXPECT_EQUALS(0,m_count,0,NULL); mysql_stmt_bind_result(stmt_1,output_1); m_count = mysql_warning_count(sess_1); M_EXPECT_EQUALS(0,m_count,0,NULL); m_ret = mysql_stmt_fetch(stmt_1); M_EXPECT_EQUALS(1,m_ret,STMT,stmt_1); m_count = mysql_warning_count(sess_1); M_EXPECT_EQUALS(0,m_count,0,NULL); m_err = mysql_stmt_errno(stmt_1); M_EXPECT_EQUALS( 2013,m_err,STMT,stmt_1 ); // Lost connection to MySQL server during query m_ret = mysql_stmt_free_result(stmt_1); M_EXPECT_EQUALS(0,m_ret,STMT,stmt_1); m_ret = mysql_stmt_reset(stmt_1); M_EXPECT_EQUALS(1,m_ret,STMT,stmt_1); m_err = mysql_stmt_errno(stmt_1); M_EXPECT_EQUALS( 2006,m_err,STMT,stmt_1 ); // MySQL server has gone away m_ret = mysql_stmt_close(stmt_1); M_EXPECT_EQUALS(0,m_ret,0,NULL); m_ret = mysql_rollback(sess_1); M_EXPECT_EQUALS(1,m_ret,SESS,sess_1); m_err = mysql_errno(sess_1); M_EXPECT_EQUALS( 2006,m_err,SESS,sess_1 ); // MySQL server has gone away m_ret = mysql_rollback(sess_1); M_EXPECT_EQUALS(1,m_ret,SESS,sess_1); m_err = mysql_errno(sess_1); M_EXPECT_EQUALS( 2006,m_err,SESS,sess_1 ); // MySQL server has gone away // ****** End of trace ****** } // Following code creates all tables needed to run this trace void create_tables( void ) { } #if 0 // Output of "show variables" # # #endif // Output of "show variables"