From dbf62f252a7d0dbfa0fa0d99e18ff5f21e670c0a Mon Sep 17 00:00:00 2001 From: "tnurnberg@salvation.intern.azundris.com" <> Date: Mon, 7 Aug 2006 07:35:28 +0200 Subject: [PATCH 1/7] Bug #20987: str_to_date doesn't accept user variable for specification str_to_date() would sometimes render NULL if %D was used as rule other than last. since this was due to two pointers getting mixed up in the server, this behaviour seemed somewhat non-deterministic at SQL level. --- mysql-test/r/func_time.result | 34 ++++++++++++++++++++++++++++++++++ mysql-test/t/func_time.test | 32 +++++++++++++++++++++++++++++++- sql/item_timefunc.cc | 2 +- 3 files changed, 66 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index d8ba606a558..d8797fd454b 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -695,3 +695,37 @@ t1 CREATE TABLE `t1` ( `from_unixtime(1) + 0` double(23,6) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +SET @df:="%M %D, %Y"; +SELECT DATE_FORMAT('2005-10-31', "%M %D, %Y"); +DATE_FORMAT('2005-10-31', "%M %D, %Y") +October 31st, 2005 +SELECT DATE_FORMAT('2005-10-31', @df); +DATE_FORMAT('2005-10-31', @df) +October 31st, 2005 +SELECT STR_TO_DATE('October 31st, 2005', "%M %D, %Y"); +STR_TO_DATE('October 31st, 2005', "%M %D, %Y") +2005-10-31 +SELECT STR_TO_DATE('October 31st, 2005', @df); +STR_TO_DATE('October 31st, 2005', @df) +2005-10-31 +CREATE TABLE `dt` ( +d datetime, +ds char(30) +); +INSERT INTO `dt` (d) VALUES ('2005-10-31'), ('2005-11-30'); +SET @df:="%M %D, %Y"; +UPDATE dt SET ds = DATE_FORMAT(d, @df); +SELECT * FROM dt; +d ds +2005-10-31 00:00:00 October 31st, 2005 +2005-11-30 00:00:00 November 30th, 2005 +SELECT d, ds, STR_TO_DATE(ds, @df) FROM dt; +d ds STR_TO_DATE(ds, @df) +2005-10-31 00:00:00 October 31st, 2005 2005-10-31 +2005-11-30 00:00:00 November 30th, 2005 2005-11-30 +SELECT d, ds, STR_TO_DATE(ds, "%M %D, %Y") FROM dt; +d ds STR_TO_DATE(ds, "%M %D, %Y") +2005-10-31 00:00:00 October 31st, 2005 2005-10-31 +2005-11-30 00:00:00 November 30th, 2005 2005-11-30 +DROP TABLE `dt`; +End of 4.1 tests diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index b8647a281d4..bf17efbd67e 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -368,4 +368,34 @@ create table t1 select now() - now(), curtime() - curtime(), show create table t1; drop table t1; -# End of 4.1 tests + + +# +# Bug #20987: str_to_date doesn't accept user variable for specification +# + +SET @df:="%M %D, %Y"; +SELECT DATE_FORMAT('2005-10-31', "%M %D, %Y"); +SELECT DATE_FORMAT('2005-10-31', @df); +SELECT STR_TO_DATE('October 31st, 2005', "%M %D, %Y"); +SELECT STR_TO_DATE('October 31st, 2005', @df); + +CREATE TABLE `dt` ( + d datetime, + ds char(30) +); + +INSERT INTO `dt` (d) VALUES ('2005-10-31'), ('2005-11-30'); +SET @df:="%M %D, %Y"; + +UPDATE dt SET ds = DATE_FORMAT(d, @df); + +SELECT * FROM dt; +SELECT d, ds, STR_TO_DATE(ds, @df) FROM dt; +SELECT d, ds, STR_TO_DATE(ds, "%M %D, %Y") FROM dt; + +DROP TABLE `dt`; + + + +--echo End of 4.1 tests diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 44d9b422263..e3b71851824 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -223,7 +223,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, tmp= (char*) val + min(2, val_len); l_time->day= (int) my_strtoll10(val, &tmp, &error); /* Skip 'st, 'nd, 'th .. */ - val= tmp + min((int) (end-tmp), 2); + val= tmp + min((int) (val_end-tmp), 2); break; /* Hour */ From 88b91d1e020ec91af90cb82c4f426efc7711c5ed Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Wed, 16 Aug 2006 19:30:46 +0300 Subject: [PATCH 2/7] Fix for bug#21537, "Error at startup" These variables must be defined for Netware, or it fails to recognize hard paths starting from the device. --- include/config-netware.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/config-netware.h b/include/config-netware.h index 5a8b926a669..a3cd6635bae 100644 --- a/include/config-netware.h +++ b/include/config-netware.h @@ -101,6 +101,10 @@ extern "C" { /* On NetWare, to fix the problem with the deletion of open files */ #define CANT_DELETE_OPEN_FILES 1 +#define FN_LIBCHAR '\\' +#define FN_ROOTDIR "\\" +#define FN_DEVCHAR ':' + /* default directory information */ #define DEFAULT_MYSQL_HOME "sys:/mysql" #define PACKAGE "mysql" From a6a8ea0bc95c7d6a116f7e56b53a132f0dd818c8 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Wed, 16 Aug 2006 20:38:33 +0200 Subject: [PATCH 3/7] Remove duplicate free of "ds_res" --- client/mysqltest.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 549c6e85837..0f0abe682b5 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -4957,9 +4957,6 @@ int main(int argc, char **argv) die("No queries executed but result file found!"); } - - dynstr_free(&ds_res); - if (!got_end_timer) timer_output(); /* No end_timer cmd, end it */ free_used_memory(); From c8d1c498fb4a7298e5c5a7e66c541f2ef7dcd325 Mon Sep 17 00:00:00 2001 From: "tnurnberg@salvation.intern.azundris.com" <> Date: Fri, 18 Aug 2006 14:16:11 +0200 Subject: [PATCH 4/7] innodb r702 innodb r719 --- innobase/btr/btr0btr.c | 2 +- innobase/buf/buf0buf.c | 5 +++-- innobase/dict/dict0dict.c | 11 +++++------ innobase/fil/fil0fil.c | 9 +++------ innobase/fsp/fsp0fsp.c | 2 +- innobase/include/btr0cur.ic | 4 +--- innobase/include/buf0buf.ic | 8 ++++---- innobase/log/log0log.c | 2 +- innobase/log/log0recv.c | 4 ++-- innobase/os/os0file.c | 12 ++++++------ innobase/row/row0mysql.c | 27 +++++++++++++-------------- innobase/row/row0sel.c | 2 +- innobase/srv/srv0start.c | 2 +- innobase/ut/ut0dbg.c | 2 +- sql/ha_innodb.cc | 31 ++++++++++++------------------- 15 files changed, 55 insertions(+), 68 deletions(-) diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c index c27fb73ff8d..07bc04feae6 100644 --- a/innobase/btr/btr0btr.c +++ b/innobase/btr/btr0btr.c @@ -616,7 +616,7 @@ btr_page_get_father_for_rec( fputs( "InnoDB: You should dump + drop + reimport the table to fix the\n" "InnoDB: corruption. If the crash happens at the database startup, see\n" -"InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html about\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html about\n" "InnoDB: forcing recovery. Then dump + drop + reimport.\n", stderr); } diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c index 99509a89de0..db09a931c29 100644 --- a/innobase/buf/buf0buf.c +++ b/innobase/buf/buf0buf.c @@ -323,7 +323,8 @@ buf_page_is_corrupted( "InnoDB: is in the future! Current system log sequence number %lu %lu.\n" "InnoDB: Your database may be corrupt or you may have copied the InnoDB\n" "InnoDB: tablespace but not the InnoDB log files. See\n" -"http://dev.mysql.com/doc/mysql/en/backing-up.html for more information.\n", +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n" +"InnoDB: for more information.\n", (ulong) mach_read_from_4(read_buf + FIL_PAGE_OFFSET), (ulong) ut_dulint_get_high( mach_read_from_8(read_buf + FIL_PAGE_LSN)), @@ -1867,7 +1868,7 @@ buf_page_io_complete( "InnoDB: the corrupt table. You can use CHECK\n" "InnoDB: TABLE to scan your table for corruption.\n" "InnoDB: See also " - "http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n" "InnoDB: about forcing recovery.\n", stderr); if (srv_force_recovery < SRV_FORCE_IGNORE_CORRUPT) { diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index bad8886d0be..fffe851bc52 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -2228,8 +2228,8 @@ dict_foreign_error_report( if (fk->foreign_index) { fputs("The index in the foreign key in table is ", file); ut_print_name(file, NULL, fk->foreign_index->name); - fputs( -"\nSee http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html\n" + fputs("\n" +"See http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html\n" "for correct foreign key definition.\n", file); } @@ -3131,7 +3131,7 @@ col_loop1: ut_print_name(ef, NULL, name); fprintf(ef, " where the columns appear\n" "as the first columns. Constraint:\n%s\n" -"See http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html\n" +"See http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html\n" "for correct foreign key definition.\n", start_of_latest_foreign); mutex_exit(&dict_foreign_err_mutex); @@ -3399,7 +3399,7 @@ try_find_index: "Note that the internal storage type of ENUM and SET changed in\n" "tables created with >= InnoDB-4.1.12, and such columns in old tables\n" "cannot be referenced by such columns in new tables.\n" -"See http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html\n" +"See http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html\n" "for correct foreign key definition.\n", start_of_latest_foreign); mutex_exit(&dict_foreign_err_mutex); @@ -4059,8 +4059,7 @@ dict_update_statistics_low( fprintf(stderr, " InnoDB: cannot calculate statistics for table %s\n" "InnoDB: because the .ibd file is missing. For help, please refer to\n" -"InnoDB: " -"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n", +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n", table->name); return; diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c index 2272f7cd8b3..64987294654 100644 --- a/innobase/fil/fil0fil.c +++ b/innobase/fil/fil0fil.c @@ -2689,8 +2689,7 @@ fil_open_single_table_tablespace( "InnoDB: It is also possible that this is a temporary table #sql...,\n" "InnoDB: and MySQL removed the .ibd file for this.\n" "InnoDB: Please refer to\n" -"InnoDB:" -" http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n" "InnoDB: for how to resolve the issue.\n", stderr); mem_free(filepath); @@ -2729,8 +2728,7 @@ fil_open_single_table_tablespace( "InnoDB: Have you moved InnoDB .ibd files around without using the\n" "InnoDB: commands DISCARD TABLESPACE and IMPORT TABLESPACE?\n" "InnoDB: Please refer to\n" -"InnoDB:" -" http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n" "InnoDB: for how to resolve the issue.\n", (ulong) space_id, (ulong) id); ret = FALSE; @@ -3375,8 +3373,7 @@ fil_space_for_table_exists_in_mem( error_exit: fputs( "InnoDB: Please refer to\n" -"InnoDB:" -" http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n" "InnoDB: for how to resolve the issue.\n", stderr); mem_free(path); diff --git a/innobase/fsp/fsp0fsp.c b/innobase/fsp/fsp0fsp.c index ad4228f6797..333894d2312 100644 --- a/innobase/fsp/fsp0fsp.c +++ b/innobase/fsp/fsp0fsp.c @@ -2975,7 +2975,7 @@ fseg_free_page_low( crash: fputs( "InnoDB: Please refer to\n" -"InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n" "InnoDB: about forcing recovery.\n", stderr); ut_error; } diff --git a/innobase/include/btr0cur.ic b/innobase/include/btr0cur.ic index bf8a6efb68d..dcad3e9e14d 100644 --- a/innobase/include/btr0cur.ic +++ b/innobase/include/btr0cur.ic @@ -52,9 +52,7 @@ btr_cur_get_page( /* out: pointer to page */ btr_cur_t* cursor) /* in: tree cursor */ { - page_t* page = buf_frame_align(page_cur_get_rec(&(cursor->page_cur))); - ut_ad(!!page_is_comp(page) == cursor->index->table->comp); - return(page); + return(buf_frame_align(page_cur_get_rec(&(cursor->page_cur)))); } /************************************************************* diff --git a/innobase/include/buf0buf.ic b/innobase/include/buf0buf.ic index d949254d47d..af32db10b5f 100644 --- a/innobase/include/buf0buf.ic +++ b/innobase/include/buf0buf.ic @@ -215,8 +215,8 @@ buf_block_align( "InnoDB: Error: trying to access a stray pointer %p\n" "InnoDB: buf pool start is at %p, end at %p\n" "InnoDB: Probable reason is database corruption or memory\n" -"InnoDB: corruption. If this happens in an InnoDB database recovery,\n" -"InnoDB: you can look from section 6.1 at http://www.innodb.com/ibman.html\n" +"InnoDB: corruption. If this happens in an InnoDB database recovery, see\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n" "InnoDB: how to force recovery.\n", ptr, frame_zero, buf_pool->high_end); @@ -251,8 +251,8 @@ buf_frame_align( "InnoDB: Error: trying to access a stray pointer %p\n" "InnoDB: buf pool start is at %p, end at %p\n" "InnoDB: Probable reason is database corruption or memory\n" -"InnoDB: corruption. If this happens in an InnoDB database recovery,\n" -"InnoDB: you can look from section 6.1 at http://www.innodb.com/ibman.html\n" +"InnoDB: corruption. If this happens in an InnoDB database recovery, see\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n" "InnoDB: how to force recovery.\n", ptr, buf_pool->frame_zero, buf_pool->high_end); diff --git a/innobase/log/log0log.c b/innobase/log/log0log.c index 2f76bf450db..2d3bff522e2 100644 --- a/innobase/log/log0log.c +++ b/innobase/log/log0log.c @@ -720,7 +720,7 @@ failure: "InnoDB: To get mysqld to start up, set innodb_thread_concurrency in my.cnf\n" "InnoDB: to a lower value, for example, to 8. After an ERROR-FREE shutdown\n" "InnoDB: of mysqld you can adjust the size of ib_logfiles, as explained in\n" -"InnoDB: http://dev.mysql.com/doc/mysql/en/Adding_and_removing.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/adding-and-removing.html\n" "InnoDB: Cannot continue operation. Calling exit(1).\n", (ulong)srv_thread_concurrency); diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c index 7c56fe35d48..113d237b535 100644 --- a/innobase/log/log0recv.c +++ b/innobase/log/log0recv.c @@ -543,7 +543,7 @@ recv_find_max_checkpoint( "InnoDB: the problem may be that during an earlier attempt you managed\n" "InnoDB: to create the InnoDB data files, but log file creation failed.\n" "InnoDB: If that is the case, please refer to\n" -"InnoDB: http://dev.mysql.com/doc/mysql/en/Error_creating_InnoDB.html\n"); +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/error-creating-innodb.html\n"); return(DB_ERROR); } @@ -1954,7 +1954,7 @@ recv_report_corrupt_log( "InnoDB: far enough in recovery! Please run CHECK TABLE\n" "InnoDB: on your InnoDB tables to check that they are ok!\n" "InnoDB: If mysqld crashes after this recovery, look at\n" - "InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n" + "InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n" "InnoDB: about forcing recovery.\n", stderr); fflush(stderr); diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index df819b73ea6..075005c3611 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -248,7 +248,7 @@ os_file_get_last_error( fprintf(stderr, "InnoDB: Some operating system error numbers are described at\n" "InnoDB: " - "http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n"); + "http://dev.mysql.com/doc/refman/5.0/en/operating-system-error-codes.html\n"); } } @@ -295,7 +295,7 @@ os_file_get_last_error( fprintf(stderr, "InnoDB: Some operating system error numbers are described at\n" "InnoDB: " - "http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n"); + "http://dev.mysql.com/doc/refman/5.0/en/operating-system-error-codes.html\n"); } } @@ -709,7 +709,7 @@ next_file: /* TODO: test Windows symlinks */ /* TODO: MySQL has apparently its own symlink implementation in Windows, dbname.sym can redirect a database directory: -http://www.mysql.com/doc/en/Windows_symbolic_links.html */ +http://dev.mysql.com/doc/refman/5.0/en/windows-symbolic-links.html */ info->type = OS_FILE_TYPE_LINK; } else if (lpFindFileData->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { @@ -2364,7 +2364,7 @@ retry: "InnoDB: offset %lu %lu. Operating system error number %lu.\n" "InnoDB: Some operating system error numbers are described at\n" "InnoDB: " -"http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n", +"http://dev.mysql.com/doc/refman/5.0/en/operating-system-error-codes.html\n", name, (ulong) offset_high, (ulong) offset, (ulong) GetLastError()); @@ -2429,7 +2429,7 @@ retry: fprintf(stderr, "InnoDB: Some operating system error numbers are described at\n" "InnoDB: " -"http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n"); +"http://dev.mysql.com/doc/refman/5.0/en/operating-system-error-codes.html\n"); os_has_said_disk_full = TRUE; } @@ -2465,7 +2465,7 @@ retry: fprintf(stderr, "InnoDB: Some operating system error numbers are described at\n" "InnoDB: " -"http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n"); +"http://dev.mysql.com/doc/refman/5.0/en/operating-system-error-codes.html\n"); os_has_said_disk_full = TRUE; } diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 9e922a3e04a..955c7139de7 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -547,7 +547,7 @@ handle_new_error: "InnoDB: tables and recreate the whole InnoDB tablespace.\n" "InnoDB: If the mysqld server crashes after the startup or when\n" "InnoDB: you dump the tables, look at\n" - "InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html" + "InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html" " for help.\n", stderr); } else { @@ -1077,7 +1077,7 @@ row_insert_for_mysql( "InnoDB: Have you deleted the .ibd file from the database directory under\n" "InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n" "InnoDB: Look from\n" -"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n" "InnoDB: how you can resolve the problem.\n", prebuilt->table->name); return(DB_ERROR); @@ -1312,7 +1312,7 @@ row_update_for_mysql( "InnoDB: Have you deleted the .ibd file from the database directory under\n" "InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n" "InnoDB: Look from\n" -"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n" "InnoDB: how you can resolve the problem.\n", prebuilt->table->name); return(DB_ERROR); @@ -1964,8 +1964,8 @@ row_create_table_for_mysql( "InnoDB: Then MySQL thinks the table exists, and DROP TABLE will\n" "InnoDB: succeed.\n" "InnoDB: You can look for further help from\n" - "InnoDB: http://dev.mysql.com/doc/mysql/en/" - "InnoDB_troubleshooting_datadict.html\n", stderr); +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n", + stderr); } /* We may also get err == DB_ERROR if the .ibd file for the @@ -3207,8 +3207,8 @@ row_drop_table_for_mysql( "InnoDB: Have you copied the .frm file of the table to the\n" "InnoDB: MySQL database directory from another database?\n" "InnoDB: You can look for further help from\n" - "InnoDB: http://dev.mysql.com/doc/mysql/en/" - "InnoDB_troubleshooting_datadict.html\n", stderr); +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n", + stderr); goto funct_exit; } @@ -3675,8 +3675,8 @@ row_rename_table_for_mysql( "InnoDB: Have you copied the .frm file of the table to the\n" "InnoDB: MySQL database directory from another database?\n" "InnoDB: You can look for further help from\n" - "InnoDB: http://dev.mysql.com/doc/mysql/en/" - "InnoDB_troubleshooting_datadict.html\n", stderr); +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n", + stderr); goto funct_exit; } @@ -3689,8 +3689,8 @@ row_rename_table_for_mysql( fputs( " does not have an .ibd file in the database directory.\n" "InnoDB: You can look for further help from\n" - "InnoDB: http://dev.mysql.com/doc/mysql/en/" - "InnoDB_troubleshooting_datadict.html\n", stderr); +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n", + stderr); goto funct_exit; } @@ -3829,8 +3829,7 @@ row_rename_table_for_mysql( fputs(" to it.\n" "InnoDB: Have you deleted the .frm file and not used DROP TABLE?\n" "InnoDB: You can look for further help from\n" - "InnoDB: http://dev.mysql.com/doc/mysql/en/" - "InnoDB_troubleshooting_datadict.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n" "InnoDB: If table ", stderr); ut_print_name(stderr, trx, new_name); fputs( @@ -4081,7 +4080,7 @@ row_check_table_for_mysql( "InnoDB: Have you deleted the .ibd file from the database directory under\n" "InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n" "InnoDB: Look from\n" -"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n" "InnoDB: how you can resolve the problem.\n", prebuilt->table->name); return(DB_ERROR); diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 23971767e7e..ec56afbb4f5 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -3101,7 +3101,7 @@ row_search_for_mysql( "InnoDB: Have you deleted the .ibd file from the database directory under\n" "InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n" "InnoDB: Look from\n" -"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n" "InnoDB: how you can resolve the problem.\n", prebuilt->table->name); diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index b345a27af20..6e0dc720bf8 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -1715,7 +1715,7 @@ NetWare. */ "InnoDB: You have now successfully upgraded to the multiple tablespaces\n" "InnoDB: format. You should NOT DOWNGRADE to an earlier version of\n" "InnoDB: InnoDB! But if you absolutely need to downgrade, see\n" -"InnoDB: http://dev.mysql.com/doc/mysql/en/Multiple_tablespaces.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/multiple-tablespaces.html\n" "InnoDB: for instructions.\n"); } diff --git a/innobase/ut/ut0dbg.c b/innobase/ut/ut0dbg.c index e810d8dead7..8b284e47286 100644 --- a/innobase/ut/ut0dbg.c +++ b/innobase/ut/ut0dbg.c @@ -54,7 +54,7 @@ ut_dbg_assertion_failed( "InnoDB: If you get repeated assertion failures or crashes, even\n" "InnoDB: immediately after the mysqld startup, there may be\n" "InnoDB: corruption in the InnoDB tablespace. Please refer to\n" -"InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n" +"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n" "InnoDB: about forcing recovery.\n", stderr); ut_dbg_stop_threads = TRUE; } diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 472506f9903..c56be6376d0 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2190,8 +2190,7 @@ ha_innobase::open( "have forgotten\nto delete the corresponding " ".frm files of InnoDB tables, or you\n" "have moved .frm files to another database?\n" - "Look from section 15.1 of " - "http://www.innodb.com/ibman.html\n" + "See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n" "how you can resolve the problem.\n", norm_name); free_share(share); @@ -2208,8 +2207,7 @@ ha_innobase::open( "Have you deleted the .ibd file from the " "database directory under\nthe MySQL datadir, " "or have you used DISCARD TABLESPACE?\n" - "Look from section 15.1 of " - "http://www.innodb.com/ibman.html\n" + "See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n" "how you can resolve the problem.\n", norm_name); free_share(share); @@ -5384,13 +5382,14 @@ ha_innobase::info( for (i = 0; i < table->s->keys; i++) { if (index == NULL) { ut_print_timestamp(stderr); - sql_print_error("Table %s contains less " + sql_print_error("Table %s contains fewer " "indexes inside InnoDB than " "are defined in the MySQL " ".frm file. Have you mixed up " ".frm files from different " - "installations? See section " - "15.1 at http://www.innodb.com/ibman.html", + "installations? See " +"http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n", + ib_table->name); break; } @@ -5399,17 +5398,11 @@ ha_innobase::info( if (j + 1 > index->n_uniq) { ut_print_timestamp(stderr); - sql_print_error("Index %s of %s has " - "%lu columns unique " - "inside InnoDB, but " - "MySQL is asking " - "statistics for %lu " - "columns. Have you " - "mixed up .frm files " - "from different " - "installations? See " - "section 15.1 at " - "http://www.innodb.com/ibman.html", + sql_print_error( +"Index %s of %s has %lu columns unique inside InnoDB, but MySQL is asking " +"statistics for %lu columns. Have you mixed up .frm files from different " +"installations? " +"See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n", index->name, ib_table->name, (unsigned long) @@ -6207,7 +6200,7 @@ ha_innobase::transactional_table_lock( "table %s does not exist.\n" "Have you deleted the .ibd file from the database directory under\n" "the MySQL datadir?" -"Look from section 15.1 of http://www.innodb.com/ibman.html\n" +"See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n" "how you can resolve the problem.\n", prebuilt->table->name); DBUG_RETURN(HA_ERR_CRASHED); From 2b2985e0eaf83be1a728abfb22c510e1badb2620 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Mon, 21 Aug 2006 14:06:59 +0200 Subject: [PATCH 5/7] Print lines from log file to see what's in them --- tests/mysql_client_test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index c64ebc9e281..8d85358d740 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -14963,6 +14963,8 @@ static void test_bug17667() DIE("Read error"); } } + /* Print the line */ + printf("%s", line_buffer); } while (my_memmem(line_buffer, MAX_TEST_QUERY_LENGTH*2, statement_cursor->buffer, statement_cursor->length) == NULL); From 39a8fe6e4490f77a731c33f80cfd2e307d9bb028 Mon Sep 17 00:00:00 2001 From: "iggy@rolltop.ignatz42.dyndns.org" <> Date: Mon, 21 Aug 2006 20:29:11 -0400 Subject: [PATCH 6/7] Bug#21757: mysql_client_test fails in testcase when reading master.log file --- tests/mysql_client_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 88c1a5737d3..427994f832f 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -14950,7 +14950,7 @@ static void test_bug17667() strcpy(master_log_filename, opt_vardir); strcat(master_log_filename, "/log/master.log"); printf("Opening '%s'\n", master_log_filename); - log_file= fopen(master_log_filename, "r"); + log_file= my_fopen(master_log_filename, (int) (O_RDONLY | O_BINARY), MYF(MY_WME)); free(master_log_filename); if (log_file != NULL) { @@ -14997,7 +14997,7 @@ static void test_bug17667() } if (log_file != NULL) - fclose(log_file); + my_fclose(log_file, MYF(0)); } From 002adef0e184a3dd28ab162a27fce402c66e0f57 Mon Sep 17 00:00:00 2001 From: "tnurnberg@salvation.intern.azundris.com" <> Date: Tue, 22 Aug 2006 14:29:48 +0200 Subject: [PATCH 7/7] Bug#20411: "GRANT ... REQUIRE ISSUER nnn AND SUBJECT mmm" fails to require both when X.509 subject was required for a connect, we tested whether it was the right one, but did not refuse the connexion if not. fixed. (corrected CS now --replace_results socket-path) --- mysql-test/r/openssl_1.result | 9 ++++++--- mysql-test/t/openssl_1.test | 10 +++++++--- sql/sql_acl.cc | 9 ++++++--- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index 1fcfb11525e..8f9fd50eced 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -3,9 +3,12 @@ create table t1(f1 int); insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com"; -grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/emailAddress=abstract.mysql.developer@mysql.com"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB"; +grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx"; flush privileges; +connect(localhost,ssl_user5,,test,MASTER_PORT,MASTER_SOCKET); +ERROR 28000: Access denied for user 'ssl_user5'@'localhost' (using password: NO) SHOW STATUS LIKE 'Ssl_cipher'; Variable_name Value Ssl_cipher DHE-RSA-AES256-SHA @@ -39,7 +42,7 @@ f1 delete from t1; ERROR 42000: DELETE command denied to user 'ssl_user4'@'localhost' for table 't1' drop user ssl_user1@localhost, ssl_user2@localhost, -ssl_user3@localhost, ssl_user4@localhost; +ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost; drop table t1; mysqltest: Could not open connection 'default': 2026 SSL connection error mysqltest: Could not open connection 'default': 2026 SSL connection error diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index afee381f5b7..49f8fc4d7d4 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -10,14 +10,18 @@ insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com"; -grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/emailAddress=abstract.mysql.developer@mysql.com"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB"; +grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx"; flush privileges; connect (con1,localhost,ssl_user1,,,,,SSL); connect (con2,localhost,ssl_user2,,,,,SSL); connect (con3,localhost,ssl_user3,,,,,SSL); connect (con4,localhost,ssl_user4,,,,,SSL); +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT +--error 1045 +connect (con5,localhost,ssl_user5,,,,,SSL); connection con1; # Check ssl turned on @@ -49,7 +53,7 @@ delete from t1; connection default; drop user ssl_user1@localhost, ssl_user2@localhost, -ssl_user3@localhost, ssl_user4@localhost; +ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost; drop table t1; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 3735f4403de..11e40473ffc 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -874,6 +874,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, sql_print_information("X509 issuer mismatch: should be '%s' " "but is '%s'", acl_user->x509_issuer, ptr); free(ptr); + user_access=NO_ACCESS; break; } user_access= acl_user->access; @@ -889,11 +890,13 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, if (strcmp(acl_user->x509_subject,ptr)) { if (global_system_variables.log_warnings) - sql_print_information("X509 subject mismatch: '%s' vs '%s'", + sql_print_information("X509 subject mismatch: should be '%s' but is '%s'", acl_user->x509_subject, ptr); + free(ptr); + user_access=NO_ACCESS; + break; } - else - user_access= acl_user->access; + user_access= acl_user->access; free(ptr); } break;