From c958795a0af1a5ebf7a0385820afaf7024af0424 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Jan 2006 14:20:28 +0400 Subject: Big patch to make embedded-server working in 5.x Now it supports queries returning several results (particularly important with the SP) include/mysql.h: embedded_query_result structure added libmysql/libmysql.c: embedded-server related fixes libmysqld/emb_qcache.cc: multiple-result support added libmysqld/embedded_priv.h: embedded_query_result struct implemented libmysqld/lib_sql.cc: multiple-result support added libmysqld/libmysqld.c: small fixes mysql-test/t/backup.test: test fixed mysql-test/t/binlog_stm_binlog.test: test fixed mysql-test/t/binlog_stm_blackhole.test: test fixed mysql-test/t/binlog_stm_ctype_cp932.test: test fixed mysql-test/t/compress.test: test fixed mysql-test/t/delayed.test: test fixed mysql-test/t/federated.test: test fixed mysql-test/t/federated_archive.test: test fixed mysql-test/t/federated_bug_13118.test: test fixed mysql-test/t/federated_transactions.test: test fixed mysql-test/t/flush_table.test: test fixed mysql-test/t/handler.test: test fixed mysql-test/t/init_connect.test: test fixed mysql-test/t/innodb.test: test fixed mysql-test/t/mysql.test: test fixed mysql-test/t/mysql_client_test.test: test fixed mysql-test/t/mysqltest.test: test fixed mysql-test/t/query_cache.test: test fixed mysql-test/t/query_cache_notembedded.test: test fixed mysql-test/t/read_only.test: test fixed mysql-test/t/skip_grants.test: test fixed mysql-test/t/sp-destruct.test: test fixed mysql-test/t/sp-error.test: test fixed mysql-test/t/sp-threads.test: test fixed mysql-test/t/sp.test: test fixed mysql-test/t/view.test: test fixed mysql-test/t/wait_timeout.test: test fixed sql-common/client.c: small fixes sql/mysqld.cc: embedded-server related fix sql/protocol.cc: embedded-server related fix sql/protocol.h: embedded-server related fix sql/sql_class.cc: embedded-server related fix sql/sql_class.h: embedded-server related fix sql/sql_cursor.cc: embedded-server related fix sql/sql_parse.cc: embedded-server related fix sql/sql_prepare.cc: embedded-server related fix --- libmysqld/libmysqld.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'libmysqld/libmysqld.c') diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index 70074e44c6f..cad1bd4c47b 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -14,6 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include +#include +#include +#include #include "embedded_priv.h" #include #include @@ -193,7 +198,12 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, if (!user) user= ""; - mysql->user=my_strdup(user,MYF(0)); + /* + We need to alloc some space for mysql->info but don't want to + put extra 'my_free's in mysql_close. + So we alloc it with the 'user' string to be freed at once + */ + mysql->user= my_strdup(user, MYF(0)); port=0; unix_socket=0; @@ -207,6 +217,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, if (db) client_flag|=CLIENT_CONNECT_WITH_DB; + mysql->info_buffer= my_malloc(MYSQL_ERRMSG_SIZE, MYF(0)); mysql->thd= create_embedded_thd(client_flag, db_name); init_embedded_mysql(mysql, client_flag, db_name); @@ -243,7 +254,6 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, DBUG_RETURN(mysql); error: - embedded_get_error(mysql); DBUG_PRINT("error",("message: %u (%s)", mysql->net.last_errno, mysql->net.last_error)); { -- cgit v1.2.1