From b321b7c00d5f41c47e652e0ae56489730309ee57 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Jan 2004 18:56:21 +0200 Subject: [PATCH 1/5] row0mysql.c: Fix typo innobase/row/row0mysql.c: Fix typo --- innobase/row/row0mysql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index d5472219d09..cf7a3efcdfc 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -1447,7 +1447,7 @@ row_create_table_for_mysql( fprintf(stderr, " InnoDB: Error: table %s already exists in InnoDB internal\n" "InnoDB: data dictionary. Have you deleted the .frm file\n" - "InnoDB: and not used DROPT ABLE? Have you used DROP DATABASE\n" + "InnoDB: and not used DROP TABLE? Have you used DROP DATABASE\n" "InnoDB: for InnoDB tables in MySQL version <= 3.23.43?\n" "InnoDB: See the Restrictions section of the InnoDB manual.\n", table->name); From 24f8054460a574660730024690786b877afccfd3 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 11 Jan 2004 18:15:19 +0100 Subject: [PATCH 2/5] Detect unexpected return codes of mysqltest in mysql-test-run. This way, a crash of mysqltest will be visible in the test logs (output of mysql-test-run). mysql-test/mysql-test-run.sh: by design mysqltest returns 0 or 1 or 2 (see the exit()s and the return() of main()). So any greater code is a crash, I guess. On build and on my machine, 139 is segfault and 134 is assertion failure. --- mysql-test/mysql-test-run.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 265ff036998..3f7efd3d6bc 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -603,7 +603,7 @@ error () { error_is () { $ECHO "Errors are (from $TIMEFILE) :" $CAT < $TIMEFILE - $ECHO "(the last line(s) may be the ones that caused the die() in mysqltest)" + $ECHO "(the last lines may be the most important ones)" } prefix_to_8() { @@ -1309,6 +1309,9 @@ run_testcase () skip_inc $ECHO "$RES$RES_SPACE [ skipped ]" else + if [ $res -gt 2 ]; then + $ECHO "mysqltest returned unexpected code $res, it has probably crashed" >> $TIMEFILE + fi total_inc fail_inc $ECHO "$RES$RES_SPACE [ fail ]" From 6c8045d4698240bc20639c4f9631735bbed90fea Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Jan 2004 14:31:04 +0400 Subject: [PATCH 3/5] charset.c: Fixed: client crashed when there are no Index.xml file. mysys/charset.c: Fixed: client crashed when there are no Index.xml file. --- mysys/charset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/charset.c b/mysys/charset.c index f8c8237c88b..b911f29627c 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -540,7 +540,7 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags) strxmov(get_charsets_dir(buf), cs->csname, ".xml", NullS); my_read_charset_file(buf,flags); } - cs= (cs->state & MY_CS_AVAILABLE) ? cs : NULL; + cs= (cs && cs->state & MY_CS_AVAILABLE) ? cs : NULL; pthread_mutex_unlock(&THR_LOCK_charset); return cs; } From 5b8b45f19f144b5dd02879ca25572fab0db6e7be Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Jan 2004 17:43:39 +0100 Subject: [PATCH 4/5] checking 2nd level of FT index destroyed info->lastkey and CHECK TABLE erroneously treated table as corrupted bug#2190 --- myisam/mi_check.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/myisam/mi_check.c b/myisam/mi_check.c index a55929805fa..5687e7d48e3 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -551,7 +551,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, ha_checksum *key_checksum, uint level) { int flag; - uint used_length,comp_flag,nod_flag,key_length,not_used; + uint used_length,comp_flag,nod_flag,key_length=0,not_used; uchar key[MI_MAX_POSSIBLE_KEY_BUFF],*temp_buff,*keypos,*old_keypos,*endpos; my_off_t next_page,record; char llbuff[22]; @@ -586,6 +586,8 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, } for ( ;; ) { + memcpy((char*) info->lastkey,(char*) key,key_length); + info->lastkey_length=key_length; if (nod_flag) { next_page=_mi_kpos(nod_flag,keypos); @@ -629,8 +631,6 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, } (*key_checksum)+= mi_byte_checksum((byte*) key, key_length- info->s->rec_reflength); - memcpy((char*) info->lastkey,(char*) key,key_length); - info->lastkey_length=key_length; record= _mi_dpos(info,0,key+key_length); if (keyinfo->flag & HA_FULLTEXT) /* special handling for ft2 */ { @@ -658,7 +658,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, DBUG_PRINT("test",("page: %s record: %s filelength: %s", llstr(page,llbuff),llstr(record,llbuff2), llstr(info->state->data_file_length,llbuff3))); - DBUG_DUMP("key",(byte*) info->lastkey,key_length); + DBUG_DUMP("key",(byte*) key,key_length); DBUG_DUMP("new_in_page",(char*) old_keypos,(uint) (keypos-old_keypos)); goto err; } From e90eb6f43ed987a9f69b8215bb123396ec9394aa Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Jan 2004 21:05:41 +0100 Subject: [PATCH 5/5] Fix for BUG#2333 "ALTER DATABASE on inexistent database hangs the client": mysql_alter_db() now returns -1 in case of error, so that mysql_execute_command() calls send_error(). sql/sql_db.cc: In case of error, return -1 so that mysql_execute_command() understands that it must send_error(). The double (( at the left of 'error' in the 'if' are to avoid a compiler warning. --- sql/sql_db.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 70b1d1d0d3a..08f9ace529d 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -270,11 +270,8 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) VOID(pthread_mutex_lock(&LOCK_mysql_create_db)); // do not alter database if another thread is holding read lock - if (wait_if_global_read_lock(thd,0)) - { - error= -1; + if ((error=wait_if_global_read_lock(thd,0))) goto exit2; - } /* Check directory */ (void)sprintf(path,"%s/%s/%s", mysql_data_home, db, MY_DB_OPT_FILE); @@ -307,7 +304,7 @@ exit: start_waiting_global_read_lock(thd); exit2: VOID(pthread_mutex_unlock(&LOCK_mysql_create_db)); - DBUG_RETURN(error); + DBUG_RETURN(error ? -1 : 0); /* -1 to delegate send_error() */ }