diff options
author | unknown <osku@127.(none)> | 2005-09-23 16:22:27 +0300 |
---|---|---|
committer | unknown <osku@127.(none)> | 2005-09-23 16:22:27 +0300 |
commit | e4b0b0d00cfb7e668f1890bbb050a476e45a1d5d (patch) | |
tree | 43f72da6760864b8d20d6e9cdf26fd07d9b15b08 /sql/ha_innodb.cc | |
parent | abda6dc69fa6d1fb75cf5754eb71edd10baae12c (diff) | |
download | mariadb-git-e4b0b0d00cfb7e668f1890bbb050a476e45a1d5d.tar.gz |
Fix bug #3443, better foreign key error messsages.
innobase/dict/dict0dict.c:
Add 'add_newline' parameter to dict_print_info_on_foreign_key_in_create_format.
innobase/include/dict0dict.h:
Add 'add_newline' parameter to dict_print_info_on_foreign_key_in_create_format.
innobase/include/os0file.h:
Add os_file_read_string.
innobase/include/trx0trx.h:
Add trx_set_detailed_error and trx_set_detailed_error_from_file functions
and a detailed_error field to trx_struct.
innobase/include/ut0mem.h:
Add ut_strlcpy.
innobase/os/os0file.c:
Add os_file_read_string.
innobase/row/row0ins.c:
Add row_ins_set_detailed function and call it when needed.
Adapt to changes in dict_print_info_on_foreign_key_in_create_format.
innobase/trx/trx0trx.c:
Add trx_set_detailed_error and trx_set_detailed_error_from_file.
Clear trx->detailed_error in trx_create.
innobase/ut/ut0mem.c:
Add ut_strlcpy.
mysql-test/r/innodb.result:
Add new tests, adapt existing ones whose output was changed.
mysql-test/t/innodb.test:
Add new tests, adapt existing ones whose output was changed.
sql/ha_innodb.cc:
Add get_error_message.
Clear trx->detailed_error in start_stmt and external_lock.
sql/ha_innodb.h:
Add get_error_message.
sql/handler.cc:
Add special case code in print_error for HA_ERR_ROW_IS_REFERENCED and
HA_ERR_NO_REFERENCED_ROW.
Change SETMSG to point to new error messages.
sql/share/errmsg.txt:
Add ER_ROW_IS_REFERENCED_2 and ER_NO_REFERENCED_ROW_2.
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r-- | sql/ha_innodb.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 9e10873ad63..d66996f8029 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -6065,6 +6065,8 @@ ha_innobase::start_stmt( } } + trx->detailed_error[0] = '\0'; + /* Set the MySQL flag to mark that there is an active transaction */ if (trx->active_trans == 0) { @@ -6138,6 +6140,8 @@ ha_innobase::external_lock( if (lock_type != F_UNLCK) { /* MySQL is setting a new table lock */ + trx->detailed_error[0] = '\0'; + /* Set the MySQL flag to mark that there is an active transaction */ if (trx->active_trans == 0) { @@ -6941,6 +6945,18 @@ ha_innobase::reset_auto_increment(ulonglong value) DBUG_RETURN(0); } +/* See comment in handler.cc */ +bool +ha_innobase::get_error_message(int error, String *buf) +{ + trx_t* trx = check_trx_exists(current_thd); + + buf->copy(trx->detailed_error, strlen(trx->detailed_error), + system_charset_info); + + return FALSE; +} + /*********************************************************************** Compares two 'refs'. A 'ref' is the (internal) primary key value of the row. If there is no explicitly declared non-null unique key or a primary key, then |