From f9a394dbddb83d899dd661542490d1965400bdbe Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Feb 2005 16:41:34 +0200 Subject: [PATCH 1/4] InnoDB: Fix Bug #7350 without hard-coding charset-collation numbers. innobase/data/data0type.c: Add mbminlen and mbmaxlen to dtype_t innobase/include/data0type.h: Add mbminlen and mbmaxlen to dtype_t Add dtype_get_mbminlen() and dtype_get_mbmaxlen() innobase/include/data0type.ic: Add dtype_set_mblen() Add dtype_get_mbminlen() and dtype_get_mbmaxlen() Replace innobase_is_mb_cset() with innobase_get_mb_cset() innobase/include/row0mysql.h: Add mbminlen and mbmaxlen innobase/include/row0mysql.ic: Detect UCS2 collations based on mbminlen innobase/row/row0sel.c: Detect UCS2 collations based on mbminlen sql/ha_innodb.cc: Replace innobase_is_mb_cset() with innobase_get_mb_cset() build_template(): Initialize templ->mbminlen and templ->mbmaxlen --- innobase/data/data0type.c | 4 +- innobase/include/data0type.h | 23 +++++++++- innobase/include/data0type.ic | 86 +++++++++++++++++++++++++++-------- innobase/include/row0mysql.h | 4 ++ innobase/include/row0mysql.ic | 15 ++---- innobase/row/row0sel.c | 23 +++------- sql/ha_innodb.cc | 25 +++++++--- 7 files changed, 126 insertions(+), 54 deletions(-) diff --git a/innobase/data/data0type.c b/innobase/data/data0type.c index b1297fe7a5b..b8e4dd9c7f2 100644 --- a/innobase/data/data0type.c +++ b/innobase/data/data0type.c @@ -41,7 +41,7 @@ charset-collation code for them. */ ulint data_mysql_default_charset_coll = 99999999; ulint data_mysql_latin1_swedish_charset_coll = 99999999; -dtype_t dtype_binary_val = {DATA_BINARY, 0, 0, 0}; +dtype_t dtype_binary_val = {DATA_BINARY, 0, 0, 0, 0, 0}; dtype_t* dtype_binary = &dtype_binary_val; /************************************************************************* @@ -216,6 +216,8 @@ dtype_validate( ut_a((type->prtype & DATA_MYSQL_TYPE_MASK) < DATA_N_SYS_COLS); } + ut_a(type->mbminlen <= type->mbmaxlen); + return(TRUE); } diff --git a/innobase/include/data0type.h b/innobase/include/data0type.h index 02c874836fd..bebb77ae57c 100644 --- a/innobase/include/data0type.h +++ b/innobase/include/data0type.h @@ -271,6 +271,24 @@ dtype_get_prec( /*===========*/ dtype_t* type); /************************************************************************* +Gets the minimum length of a character, in bytes. */ +UNIV_INLINE +ulint +dtype_get_mbminlen( +/*===============*/ + /* out: minimum length of a char, in bytes, + or 0 if this is not a character type */ + const dtype_t* type); /* in: type */ +/************************************************************************* +Gets the maximum length of a character, in bytes. */ +UNIV_INLINE +ulint +dtype_get_mbmaxlen( +/*===============*/ + /* out: maximum length of a char, in bytes, + or 0 if this is not a character type */ + const dtype_t* type); /* in: type */ +/************************************************************************* Gets the padding character code for the type. */ UNIV_INLINE ulint @@ -358,10 +376,13 @@ struct dtype_struct{ ulint mtype; /* main data type */ ulint prtype; /* precise type; MySQL data type */ - /* the remaining two fields do not affect alphabetical ordering: */ + /* the remaining fields do not affect alphabetical ordering: */ ulint len; /* length */ ulint prec; /* precision */ + + ulint mbminlen; /* minimum length of a character, in bytes */ + ulint mbmaxlen; /* maximum length of a character, in bytes */ }; #ifndef UNIV_NONINL diff --git a/innobase/include/data0type.ic b/innobase/include/data0type.ic index 15833905761..95da830198e 100644 --- a/innobase/include/data0type.ic +++ b/innobase/include/data0type.ic @@ -9,15 +9,46 @@ Created 1/16/1996 Heikki Tuuri #include "mach0data.h" /********************************************************************** -Determines whether the given character set is of variable length. +Get the variable length bounds of the given character set. NOTE: the prototype of this function is copied from ha_innodb.cc! If you change this function, you MUST change also the prototype here! */ extern -ibool -innobase_is_mb_cset( -/*================*/ - ulint cset); /* in: MySQL charset-collation code */ +void +innobase_get_mb_cset( +/*=================*/ + ulint cset, /* in: MySQL charset-collation code */ + ulint* mbminlen, /* out: minimum length of a char (in bytes) */ + ulint* mbmaxlen); /* out: maximum length of a char (in bytes) */ + +/************************************************************************* +Gets the MySQL charset-collation code for MySQL string types. */ +UNIV_INLINE +ulint +dtype_get_charset_coll( +/*===================*/ + ulint prtype) /* in: precise data type */ +{ + return((prtype >> 16) & 0xFFUL); +} + +/************************************************************************* +Sets the mbminlen and mbmaxlen members of a data type structure. */ +UNIV_INLINE +void +dtype_set_mblen( +/*============*/ + dtype_t* type) /* in/out: type struct */ +{ + ut_ad(type); + if (dtype_is_string_type(type->mtype)) { + innobase_get_mb_cset(dtype_get_charset_coll(type->prtype), + &type->mbminlen, &type->mbmaxlen); + ut_ad(type->mbminlen <= type->mbmaxlen); + } else { + type->mbminlen = type->mbmaxlen = 0; + } +} /************************************************************************* Sets a data type structure. */ @@ -39,6 +70,7 @@ dtype_set( type->len = len; type->prec = prec; + dtype_set_mblen(type); ut_ad(dtype_validate(type)); } @@ -82,17 +114,6 @@ dtype_get_prtype( return(type->prtype); } -/************************************************************************* -Gets the MySQL charset-collation code for MySQL string types. */ -UNIV_INLINE -ulint -dtype_get_charset_coll( -/*===================*/ - ulint prtype) /* in: precise data type */ -{ - return((prtype >> 16) & 0xFFUL); -} - /************************************************************************* Gets the type length. */ UNIV_INLINE @@ -119,6 +140,33 @@ dtype_get_prec( return(type->prec); } +/************************************************************************* +Gets the minimum length of a character, in bytes. */ +UNIV_INLINE +ulint +dtype_get_mbminlen( +/*===============*/ + /* out: minimum length of a char, in bytes, + or 0 if this is not a character type */ + const dtype_t* type) /* in: type */ +{ + ut_ad(type); + return(type->mbminlen); +} +/************************************************************************* +Gets the maximum length of a character, in bytes. */ +UNIV_INLINE +ulint +dtype_get_mbmaxlen( +/*===============*/ + /* out: maximum length of a char, in bytes, + or 0 if this is not a character type */ + const dtype_t* type) /* in: type */ +{ + ut_ad(type); + return(type->mbmaxlen); +} + /************************************************************************* Gets the padding character code for the type. */ UNIV_INLINE @@ -211,6 +259,7 @@ dtype_read_for_order_and_null_size( type->prtype = dtype_form_prtype(type->prtype, data_mysql_default_charset_coll); + dtype_set_mblen(type); } /************************************************************************** @@ -262,6 +311,7 @@ dtype_new_read_for_order_and_null_size( type->prtype = dtype_form_prtype(type->prtype, charset_coll); } + dtype_set_mblen(type); } /*************************************************************************** @@ -306,9 +356,7 @@ dtype_get_fixed_size( case DATA_DOUBLE: case DATA_MYSQL: if ((type->prtype & DATA_BINARY_TYPE) - || !innobase_is_mb_cset( - dtype_get_charset_coll( - type->prtype))) { + || type->mbminlen == type->mbmaxlen) { return(dtype_get_len(type)); } /* fall through for variable-length charsets */ diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index 2ef260829fc..7ffa6ebf87d 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -458,6 +458,10 @@ struct mysql_row_templ_struct { numbers DATA_CHAR... */ ulint charset; /* MySQL charset-collation code of the column, or zero */ + ulint mbminlen; /* minimum length of a char, in bytes, + or zero if not a char type */ + ulint mbmaxlen; /* maximum length of a char, in bytes, + or zero if not a char type */ ulint is_unsigned; /* if a column type is an integer type and this field is != 0, then it is an unsigned integer type */ diff --git a/innobase/include/row0mysql.ic b/innobase/include/row0mysql.ic index fc922b52d0a..1f5d0b0c990 100644 --- a/innobase/include/row0mysql.ic +++ b/innobase/include/row0mysql.ic @@ -93,17 +93,11 @@ row_mysql_store_col_in_innobase_format( || type == DATA_BINARY) { /* Remove trailing spaces. */ - /* Handle UCS2 strings differently. As no new - collations will be introduced in 4.1, we hardcode the - charset-collation codes here. In 5.0, the logic will - be based on mbminlen. */ - ulint cset = dtype_get_charset_coll( - dtype_get_prtype(dfield_get_type(dfield))); + /* Handle UCS2 strings differently. */ + ulint mbminlen = dtype_get_mbminlen( + dfield_get_type(dfield)); ptr = row_mysql_read_var_ref(&col_len, mysql_data); - if (cset == 35/*ucs2_general_ci*/ - || cset == 90/*ucs2_bin*/ - || (cset >= 128/*ucs2_unicode_ci*/ - && cset <= 144/*ucs2_persian_ci*/)) { + if (mbminlen == 2) { /* space=0x0020 */ /* Trim "half-chars", just in case. */ col_len &= ~1; @@ -113,6 +107,7 @@ row_mysql_store_col_in_innobase_format( col_len -= 2; } } else { + ut_a(mbminlen == 1); /* space=0x20 */ while (col_len > 0 && ptr[col_len - 1] == 0x20) { col_len--; diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 8512e796a72..c0141f896ce 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2410,14 +2410,9 @@ row_sel_store_mysql_rec( /* Pad with trailing spaces */ data = mysql_rec + templ->mysql_col_offset; - /* Handle UCS2 strings differently. As no new - collations will be introduced in 4.1, we - hardcode the charset-collation codes here. - 5.0 will use a different approach. */ - if (templ->charset == 35 - || templ->charset == 90 - || (templ->charset >= 128 - && templ->charset <= 144)) { + ut_ad(templ->mbminlen <= templ->mbmaxlen); + /* Handle UCS2 strings differently. */ + if (templ->mbminlen == 2) { /* space=0x0020 */ ulint col_len = templ->mysql_col_len; @@ -2436,6 +2431,7 @@ row_sel_store_mysql_rec( data[len++] = 0x20; } } else { + ut_ad(templ->mbminlen == 1); /* space=0x20 */ memset(data + len, 0x20, templ->mysql_col_len - len); @@ -2477,14 +2473,8 @@ row_sel_store_mysql_rec( pad_char = '\0'; } - /* Handle UCS2 strings differently. As no new - collations will be introduced in 4.1, - we hardcode the charset-collation codes here. - 5.0 will use a different approach. */ - if (templ->charset == 35 - || templ->charset == 90 - || (templ->charset >= 128 - && templ->charset <= 144)) { + /* Handle UCS2 strings differently. */ + if (templ->mbminlen == 2) { /* There are two bytes per char, so the length has to be an even number. */ ut_a(!(templ->mysql_col_len & 1)); @@ -2497,6 +2487,7 @@ row_sel_store_mysql_rec( len -= 2; } } else { + ut_ad(templ->mbminlen == 1); memset(mysql_rec + templ->mysql_col_offset, pad_char, templ->mysql_col_len); } diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index be493138fd0..16e9760d624 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -535,22 +535,31 @@ innobase_mysql_print_thd( } /********************************************************************** -Determines whether the given character set is of variable length. +Get the variable length bounds of the given character set. NOTE that the exact prototype of this function has to be in /innobase/data/data0type.ic! */ extern "C" -ibool -innobase_is_mb_cset( -/*================*/ - ulint cset) /* in: MySQL charset-collation code */ +void +innobase_get_mb_cset( +/*=================*/ + ulint cset, /* in: MySQL charset-collation code */ + ulint* mbminlen, /* out: minimum length of a char (in bytes) */ + ulint* mbmaxlen) /* out: maximum length of a char (in bytes) */ { CHARSET_INFO* cs; ut_ad(cset < 256); + ut_ad(mbminlen); + ut_ad(mbmaxlen); cs = all_charsets[cset]; - - return(cs && cs->mbminlen != cs->mbmaxlen); + if (cs) { + *mbminlen = cs->mbminlen; + *mbmaxlen = cs->mbmaxlen; + } else { + ut_a(cset == 0); + *mbminlen = *mbmaxlen = 0; + } } /********************************************************************** @@ -2453,6 +2462,8 @@ build_template( templ->type = get_innobase_type_from_mysql_type(field); templ->charset = dtype_get_charset_coll_noninline( index->table->cols[i].type.prtype); + templ->mbminlen = index->table->cols[i].type.mbminlen; + templ->mbmaxlen = index->table->cols[i].type.mbmaxlen; templ->is_unsigned = (ulint) (field->flags & UNSIGNED_FLAG); if (templ->type == DATA_BLOB) { From 93fd45904acbf5914e417ff7cd8f394efd52e850 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Feb 2005 15:54:08 +0200 Subject: [PATCH 2/4] InnoDB: Small improvements to earlier patch (fix Bug #7350 better), suggested in review by Heikki. innobase/include/data0type.h: Improve comment of dtype_struct. innobase/include/data0type.ic: Rename innobase_get_mb_cset() to innobase_get_cset_width(). dtype_get_fixed_size(): Add an extra integrity check for type->prtype, type->mbminlen and type->mbmaxlen. sql/ha_innodb.cc: Rename innobase_get_mb_cset() to innobase_get_cset_width() --- innobase/include/data0type.h | 8 ++++++- innobase/include/data0type.ic | 41 ++++++++++++++++++++++++++++++----- sql/ha_innodb.cc | 4 ++-- 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/innobase/include/data0type.h b/innobase/include/data0type.h index bebb77ae57c..4c327d0b7ed 100644 --- a/innobase/include/data0type.h +++ b/innobase/include/data0type.h @@ -370,7 +370,13 @@ dtype_print( /*========*/ dtype_t* type); /* in: type */ -/* Structure for an SQL data type */ +/* Structure for an SQL data type. +If you add fields to this structure, be sure to initialize them everywhere. +This structure is initialized in the following functions: +dtype_set() +dtype_read_for_order_and_null_size() +dtype_new_read_for_order_and_null_size() +sym_tab_add_null_lit() */ struct dtype_struct{ ulint mtype; /* main data type */ diff --git a/innobase/include/data0type.ic b/innobase/include/data0type.ic index 95da830198e..761f7b3da7f 100644 --- a/innobase/include/data0type.ic +++ b/innobase/include/data0type.ic @@ -15,8 +15,8 @@ NOTE: the prototype of this function is copied from ha_innodb.cc! If you change this function, you MUST change also the prototype here! */ extern void -innobase_get_mb_cset( -/*=================*/ +innobase_get_cset_width( +/*====================*/ ulint cset, /* in: MySQL charset-collation code */ ulint* mbminlen, /* out: minimum length of a char (in bytes) */ ulint* mbmaxlen); /* out: maximum length of a char (in bytes) */ @@ -42,7 +42,7 @@ dtype_set_mblen( { ut_ad(type); if (dtype_is_string_type(type->mtype)) { - innobase_get_mb_cset(dtype_get_charset_coll(type->prtype), + innobase_get_cset_width(dtype_get_charset_coll(type->prtype), &type->mbminlen, &type->mbmaxlen); ut_ad(type->mbminlen <= type->mbmaxlen); } else { @@ -355,9 +355,40 @@ dtype_get_fixed_size( case DATA_FLOAT: case DATA_DOUBLE: case DATA_MYSQL: - if ((type->prtype & DATA_BINARY_TYPE) - || type->mbminlen == type->mbmaxlen) { + if (type->prtype & DATA_BINARY_TYPE) { return(dtype_get_len(type)); + } else { + /* We play it safe here and ask MySQL for + mbminlen and mbmaxlen. Although + type->mbminlen and type->mbmaxlen are + initialized if and only if type->prtype + is (in one of the 3 functions in this file), + it could be that none of these functions + has been called. */ + + ulint mbminlen, mbmaxlen; + + innobase_get_cset_width( + dtype_get_charset_coll(type->prtype), + &mbminlen, &mbmaxlen); + + if (type->mbminlen != mbminlen + || type->mbmaxlen != mbmaxlen) { + + ut_print_timestamp(stderr); + fprintf(stderr, " InnoDB: " + "mbminlen=%lu, " + "mbmaxlen=%lu, " + "type->mbminlen=%lu, " + "type->mbmaxlen=%lu\n", + (ulong) mbminlen, + (ulong) mbmaxlen, + (ulong) type->mbminlen, + (ulong) type->mbmaxlen); + } + if (mbminlen == mbmaxlen) { + return(dtype_get_len(type)); + } } /* fall through for variable-length charsets */ case DATA_VARCHAR: diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 16e9760d624..e67a79446f7 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -541,8 +541,8 @@ NOTE that the exact prototype of this function has to be in /innobase/data/data0type.ic! */ extern "C" void -innobase_get_mb_cset( -/*=================*/ +innobase_get_cset_width( +/*====================*/ ulint cset, /* in: MySQL charset-collation code */ ulint* mbminlen, /* out: minimum length of a char (in bytes) */ ulint* mbmaxlen) /* out: maximum length of a char (in bytes) */ From c1085da6f8cc79170c47b58c3af38256e3e5a526 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Feb 2005 16:00:15 +0200 Subject: [PATCH 3/4] ha_innodb.cc: Fix a glitch reported by Guilhem: release the memory allocated for innodb_internal_... if innobase_init() fails; cleanups: in ha_innodb, you should use the InnoDB formatting style for the source code sql/ha_innodb.cc: Fix a glitch reported by Guilhem: release the memory allocated for innodb_internal_... if innobase_init() fails; cleanups: in ha_innodb, you should use the InnoDB formatting style for the source code --- sql/ha_innodb.cc | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 69e509f1656..bfd62d2321b 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -1079,6 +1079,8 @@ innobase_init(void) if (ret == FALSE) { sql_print_error( "InnoDB: syntax error in innodb_data_file_path"); + my_free(internal_innobase_data_file_path, + MYF(MY_ALLOW_ZERO_PTR)); DBUG_RETURN(TRUE); } @@ -1109,6 +1111,8 @@ innobase_init(void) "InnoDB: syntax error in innodb_log_group_home_dir\n" "InnoDB: or a wrong number of mirrored log groups\n"); + my_free(internal_innobase_data_file_path, + MYF(MY_ALLOW_ZERO_PTR)); DBUG_RETURN(TRUE); } @@ -1155,11 +1159,11 @@ innobase_init(void) srv_fast_shutdown = (ibool) innobase_fast_shutdown; - srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite; - srv_use_checksums = (ibool) innobase_use_checksums; + srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite; + srv_use_checksums = (ibool) innobase_use_checksums; - os_use_large_pages = (ibool) innobase_use_large_pages; - os_large_page_size = (ulint) innobase_large_page_size; + os_use_large_pages = (ibool) innobase_use_large_pages; + os_large_page_size = (ulint) innobase_large_page_size; srv_file_per_table = (ibool) innobase_file_per_table; srv_locks_unsafe_for_binlog = (ibool) innobase_locks_unsafe_for_binlog; @@ -1197,7 +1201,8 @@ innobase_init(void) err = innobase_start_or_create_for_mysql(); if (err != DB_SUCCESS) { - + my_free(internal_innobase_data_file_path, + MYF(MY_ALLOW_ZERO_PTR)); DBUG_RETURN(1); } @@ -1241,23 +1246,23 @@ innobase_end(void) set_panic_flag_for_netware(); } #endif - if (innodb_inited) - { - if (innobase_very_fast_shutdown) { - srv_very_fast_shutdown = TRUE; - fprintf(stderr, + if (innodb_inited) { + if (innobase_very_fast_shutdown) { + srv_very_fast_shutdown = TRUE; + fprintf(stderr, "InnoDB: MySQL has requested a very fast shutdown without flushing\n" "InnoDB: the InnoDB buffer pool to data files. At the next mysqld startup\n" "InnoDB: InnoDB will do a crash recovery!\n"); + } - } - - innodb_inited= 0; - if (innobase_shutdown_for_mysql() != DB_SUCCESS) - err= 1; - hash_free(&innobase_open_tables); - my_free(internal_innobase_data_file_path,MYF(MY_ALLOW_ZERO_PTR)); - pthread_mutex_destroy(&innobase_mutex); + innodb_inited = 0; + if (innobase_shutdown_for_mysql() != DB_SUCCESS) { + err = 1; + } + hash_free(&innobase_open_tables); + my_free(internal_innobase_data_file_path, + MYF(MY_ALLOW_ZERO_PTR)); + pthread_mutex_destroy(&innobase_mutex); } DBUG_RETURN(err); From b6a09ac0fa57211acd91d64c539156ec52114dcc Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Feb 2005 18:23:10 +0300 Subject: [PATCH 4/4] Fix for bug#8156:information_schema and lowercase_table3 fail on OSX Can't repeat information_schema test failure Fix for lowercase_table3 only mysql-test/r/lowercase_table3.result: Fix for bug#8156:information_schema and lowercase_table3 fail on OSX mysql-test/t/lowercase_table3.test: Fix for bug#8156:information_schema and lowercase_table3 fail on OSX sql/ha_innodb.cc: Fix for bug#8156:information_schema and lowercase_table3 fail on OSX --- mysql-test/r/lowercase_table3.result | 2 +- mysql-test/t/lowercase_table3.test | 2 +- sql/ha_innodb.cc | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/lowercase_table3.result b/mysql-test/r/lowercase_table3.result index 8182d07c26b..995a2c0d08a 100644 --- a/mysql-test/r/lowercase_table3.result +++ b/mysql-test/r/lowercase_table3.result @@ -6,5 +6,5 @@ drop table t1; flush tables; CREATE TABLE t1 (a int) ENGINE=INNODB; SELECT * from T1; -ERROR HY000: Can't open file: 'T1.ibd' (errno: 1) +ERROR 42S02: Table 'test.T1' doesn't exist drop table t1; diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test index a394cde7237..9841059a26b 100644 --- a/mysql-test/t/lowercase_table3.test +++ b/mysql-test/t/lowercase_table3.test @@ -32,6 +32,6 @@ flush tables; # CREATE TABLE t1 (a int) ENGINE=INNODB; ---error 1016 +--error 1146 SELECT * from T1; drop table t1; diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 69e509f1656..f4055115918 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -1861,7 +1861,7 @@ ha_innobase::open( my_free((char*) upd_buff, MYF(0)); my_errno = ENOENT; - DBUG_RETURN(1); + DBUG_RETURN(HA_ERR_NO_SUCH_TABLE); } if (ib_table->ibd_file_missing && !thd->tablespace_op) { @@ -1878,7 +1878,7 @@ ha_innobase::open( my_free((char*) upd_buff, MYF(0)); my_errno = ENOENT; - DBUG_RETURN(1); + DBUG_RETURN(HA_ERR_NO_SUCH_TABLE); } innobase_prebuilt = row_create_prebuilt(ib_table);