From b698b8620ea5cd5958f61fccbe56ac494604e5b5 Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Wed, 13 Apr 2005 20:21:28 +0300 Subject: [PATCH 1/2] ha_innodb.cc: Fix part of bug #9670: if MySQL calls ::store_lock with TL_IGNORE, do not change prebuilt->select_lock_type; this fix may heal the assertion failures reported in UPDATE and multi-table UPDATE; it is not clear if this fixes the problems in OPTIMIZE TABLE --- sql/ha_innodb.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index bd2a5139021..6cb35fb392d 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -5320,7 +5320,8 @@ ha_innobase::store_lock( (lock_type == TL_READ_HIGH_PRIORITY && thd->in_lock_tables) || lock_type == TL_READ_WITH_SHARED_LOCKS || lock_type == TL_READ_NO_INSERT || - thd->lex->sql_command != SQLCOM_SELECT) { + (thd->lex->sql_command != SQLCOM_SELECT + && lock_type != TL_IGNORE)) { /* The OR cases above are in this order: 1) MySQL is doing LOCK TABLES ... READ LOCAL, or From 75cfee68fb59fe0b2c5d4f7d3bb5f18d3a321060 Mon Sep 17 00:00:00 2001 From: "petr@mysql.com" <> Date: Thu, 14 Apr 2005 01:39:24 +0400 Subject: [PATCH 2/2] post review fix --- mysys/default.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/mysys/default.c b/mysys/default.c index 841a5f6004f..63323f15fd5 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -418,15 +418,16 @@ static int search_default_file_with_ext(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, /* trim trailing whitespace from directory name */ end= ptr + strlen(ptr) - 1; - /* - This would work fine even if no whitespaces are met - since fgets() stores the newline character in the buffer - */ - for (; my_isspace(&my_charset_latin1, *(end - 1)); end--) - {} - end[0]= 0; + /* fgets() stores the newline character in the buffer */ + if ((end[0] == '\n') || (end[0] == '\r') || + my_isspace(&my_charset_latin1, end[0])) + { + for (; my_isspace(&my_charset_latin1, *(end - 1)); end--) + {} + end[0]= 0; + } - /* print error msg if there is nothing after !inludedir directive */ + /* print error msg if there is nothing after !includedir directive */ if (end == ptr) { fprintf(stderr, @@ -444,7 +445,7 @@ static int search_default_file_with_ext(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, search_file= search_dir->dir_entry + i; ext= fn_ext(search_file->name); - /* check extenstion */ + /* check extension */ for (tmp_ext= (char**) f_extensions; *tmp_ext; *tmp_ext++) { if (!strcmp(ext, *tmp_ext)) @@ -496,6 +497,14 @@ static int search_default_file_with_ext(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, continue; } + else + if (recursion_level >= max_recursion_level) + { + fprintf(stderr, + "warning: skipping !include directive as maximum include" + "recursion level was reached in file %s at line %d\n", + name, line); + } if (*ptr == '[') /* Group name */ {