From c4c76c5fdb4fc2e677ee6f7b885074808910cd83 Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Fri, 13 May 2005 21:43:26 +0200 Subject: [PATCH 1/3] sql/ha_blackhole.cc bug#10175 - blackhole.test hangs with "Warning: prev link 1 didn't point at previous lock at read: read lock with no write locks" sql/sql_base.cc libmysqld/examples/mysql.cc linking problem --- sql/ha_blackhole.cc | 3 ++- sql/sql_base.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc index 7c6e7cb56b6..c9c94b3a9d7 100644 --- a/sql/ha_blackhole.cc +++ b/sql/ha_blackhole.cc @@ -129,8 +129,9 @@ THR_LOCK_DATA **ha_blackhole::store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type) { + if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK) + lock.type=lock_type; *to++= &lock; - return to; } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index c580842ce06..e86362c857b 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2522,7 +2522,7 @@ bool get_key_map_from_key_list(key_map *map, TABLE *table, if ((pos= find_type(&table->keynames, name->ptr(), name->length(), 1)) <= 0) { - my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), name->c_ptr(), + my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), name->c_ptr_safe(), table->real_name); map->set_all(); return 1; From 6adfd9436ebfa0274f9fd5c4402e8d4e1d467f52 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Sat, 14 May 2005 02:28:10 +0400 Subject: [PATCH 2/3] Fix wrong format specifier in error messages. Not to be pushed into 5.0 as there it's fixed differently (in the new format of error messages) --- sql/share/danish/errmsg.txt | 2 +- sql/share/serbian/errmsg.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index 384625f7112..4983d39714a 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -262,7 +262,7 @@ character-set=latin1 "Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt index accf1926abb..adda7d7cf53 100644 --- a/sql/share/serbian/errmsg.txt +++ b/sql/share/serbian/errmsg.txt @@ -252,7 +252,7 @@ character-set=cp1250 "Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", From 6c981c0b8005a1577c7dfd93eb656a5da46ef9f0 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Sat, 14 May 2005 02:31:26 +0400 Subject: [PATCH 3/3] Fix a valgrind warning: memcpy does not allow its arguments to overlap. --- libmysql/libmysql.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 4c9f06df38e..3fcdc6bdc4d 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -3944,9 +3944,12 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind) /* We only need to check that stmt->field_count - if it is not null stmt->bind was initialized in mysql_stmt_prepare - */ + stmt->bind overlaps with bind if mysql_stmt_bind_param + is called from mysql_stmt_store_result. + */ - memcpy((char*) stmt->bind, (char*) bind, sizeof(MYSQL_BIND) * bind_count); + if (stmt->bind != bind) + memcpy((char*) stmt->bind, (char*) bind, sizeof(MYSQL_BIND) * bind_count); for (param= stmt->bind, end= param + bind_count, field= stmt->fields ; param < end ;