-
Arun Kuruvila authored
"MALFORMED COMMUNICATION PACKET" ERROR Description :- C API, "mysql_stmt_execute" fails with an error, "malformed communication packet", even for a simple query when prepared statments are used with libmysqld. Analysis :- The packet size specified in "emb_stmt_execute()" [libmysqld/lib_sql.cc] and "execute() [libmysql/libmysql.c] should be consistent across libraries (libmysqld/libmysql) because "mysql_stmt_execute()" [sql/sql_prepare.cc ] is being called from both functions depending upon the libaries (libmysqld/libmysql) used. Currently the packet size used in "emb_stmt_execute() is 5 and in "execute()" is 9. When the C API, "mysql_stmt_execute", is executed from an application which is linked with libmysqld, it fails in the function "mysql_stmt_execute()" because of incorrect packet size. Another bug also exists in the "Protocol::net_store_data()" [libmysqld/lib_sql.cc] due to dereferencing an undefined "next_field" pointer which results in a segmentation fault. Fix:- (a)The packet size is made consistent across libmysqld and libmysql. (b) For the problem found internally: Functions "prepare_for_resend(), "net_store_data()" (with and without charset conversion) are defined seperately for Protocol_binary class in case of embedded library.
Arun Kuruvila authored"MALFORMED COMMUNICATION PACKET" ERROR Description :- C API, "mysql_stmt_execute" fails with an error, "malformed communication packet", even for a simple query when prepared statments are used with libmysqld. Analysis :- The packet size specified in "emb_stmt_execute()" [libmysqld/lib_sql.cc] and "execute() [libmysql/libmysql.c] should be consistent across libraries (libmysqld/libmysql) because "mysql_stmt_execute()" [sql/sql_prepare.cc ] is being called from both functions depending upon the libaries (libmysqld/libmysql) used. Currently the packet size used in "emb_stmt_execute() is 5 and in "execute()" is 9. When the C API, "mysql_stmt_execute", is executed from an application which is linked with libmysqld, it fails in the function "mysql_stmt_execute()" because of incorrect packet size. Another bug also exists in the "Protocol::net_store_data()" [libmysqld/lib_sql.cc] due to dereferencing an undefined "next_field" pointer which results in a segmentation fault. Fix:- (a)The packet size is made consistent across libmysqld and libmysql. (b) For the problem found internally: Functions "prepare_for_resend(), "net_store_data()" (with and without charset conversion) are defined seperately for Protocol_binary class in case of embedded library.
Loading