From 45b512b5b54a91c5d52398677e38cc4b075b84ab Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Jan 2012 10:47:57 +0100 Subject: [PATCH 01/11] Fix two .deb problems causing build/install failures in Buildbot. --- debian/autobake-deb.sh | 4 ++-- debian/dist/Debian/control | 6 ++++-- debian/dist/Ubuntu/control | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index 51cda73ee89..d2288ee8b42 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -61,9 +61,9 @@ done; # echo "Incrementing changelog and starting build scripts" -dch -b -D ${CODENAME} -v "${UPSTREAM}${PATCHLEVEL}-${RELEASE_NAME}${RELEASE_EXTRA:+-${RELEASE_EXTRA}}~${CODENAME}" "Automatic build with ${LOGSTRING}." +dch -b -D ${CODENAME} -v "${UPSTREAM}${PATCHLEVEL}-${RELEASE_NAME}${RELEASE_EXTRA:+-${RELEASE_EXTRA}}1~${CODENAME}" "Automatic build with ${LOGSTRING}." -echo "Creating package version ${UPSTREAM}${PATCHLEVEL}-${RELEASE_NAME}${RELEASE_EXTRA:+-${RELEASE_EXTRA}}~${CODENAME} ... " +echo "Creating package version ${UPSTREAM}${PATCHLEVEL}-${RELEASE_NAME}${RELEASE_EXTRA:+-${RELEASE_EXTRA}}1~${CODENAME} ... " # Build the package. # diff --git a/debian/dist/Debian/control b/debian/dist/Debian/control index b36c0469ba5..861f0ca5b11 100644 --- a/debian/dist/Debian/control +++ b/debian/dist/Debian/control @@ -89,12 +89,14 @@ Package: mariadb-client-core-5.5 Architecture: any Depends: mariadb-common, libmariadbclient18 (>= ${source:Version}), ${shlibs:Depends}, ${misc:Depends} Provides: mysql-client-core, mysql-client-core-5.1, mysql-client-core-5.5 -Conflicts: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1, mysql-client-5.5, +Conflicts: mysql-client (<< 5.0.51), mysql-client-5.0, + mysql-client-5.1 (<< ${source:Version}), mysql-client-5.5 (<< ${source:Version}), mysql-client-core-5.1, mysql-client-core-5.5, mariadb-client-5.1, mariadb-client-core-5.1, mariadb-client-5.2, mariadb-client-core-5.2, mariadb-client-5.3, mariadb-client-core-5.3 -Replaces: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1, mysql-client-5.5, +Replaces: mysql-client (<< 5.0.51), mysql-client-5.0, + mysql-client-5.1, mysql-client-5.5, mysql-client-core-5.1, mysql-client-core-5.5, mariadb-client-5.1, mariadb-client-core-5.1, mariadb-client-5.2, mariadb-client-core-5.2, diff --git a/debian/dist/Ubuntu/control b/debian/dist/Ubuntu/control index c49d1581cb3..7dd27754c97 100644 --- a/debian/dist/Ubuntu/control +++ b/debian/dist/Ubuntu/control @@ -89,12 +89,14 @@ Package: mariadb-client-core-5.5 Architecture: any Depends: mariadb-common, libmariadbclient18 (>= ${source:Version}), ${shlibs:Depends}, ${misc:Depends} Provides: mysql-client-core, mysql-client-core-5.1, mysql-client-core-5.5 -Conflicts: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1, mysql-client-5.5, +Conflicts: mysql-client (<< 5.0.51), mysql-client-5.0, + mysql-client-5.1 (<< ${source:Version}), mysql-client-5.5 (<< ${source:Version}), mysql-client-core-5.1, mysql-client-core-5.5, mariadb-client-5.1, mariadb-client-core-5.1, mariadb-client-5.2, mariadb-client-core-5.2, mariadb-client-5.3, mariadb-client-core-5.3 -Replaces: mysql-client (<< 5.0.51), mysql-client-5.0, mysql-client-5.1, mysql-client-5.5, +Replaces: mysql-client (<< 5.0.51), mysql-client-5.0, + mysql-client-5.1, mysql-client-5.5, mysql-client-core-5.1, mysql-client-core-5.5, mariadb-client-5.1, mariadb-client-core-5.1, mariadb-client-5.2, mariadb-client-core-5.2, From 92bd8a5c6023927c64a110b6137a5cfa0659a01c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Jan 2012 12:27:44 +0100 Subject: [PATCH 02/11] More small 5.5 .deb packaging fixes found in Buildbot tests. --- debian/additions/my.cnf | 3 ++- debian/dist/Debian/control | 3 +-- debian/dist/Debian/mariadb-server-5.5.files | 1 + debian/dist/Ubuntu/control | 3 +-- debian/dist/Ubuntu/mariadb-server-5.5.files | 1 + 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/debian/additions/my.cnf b/debian/additions/my.cnf index a62465e5627..1a176cc1dc1 100644 --- a/debian/additions/my.cnf +++ b/debian/additions/my.cnf @@ -54,7 +54,8 @@ port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp -language = /usr/share/mysql/english +lc_messages_dir = /usr/share/mysql +lc_messages = en_US skip-external-locking # # * Character sets diff --git a/debian/dist/Debian/control b/debian/dist/Debian/control index 861f0ca5b11..7de203fd3f0 100644 --- a/debian/dist/Debian/control +++ b/debian/dist/Debian/control @@ -178,8 +178,7 @@ Depends: mariadb-client-5.5 (>= ${source:Version}), libdbi-perl, perl (>= 5.6), Provides: mariadb-server, mysql-server, virtual-mysql-server Conflicts: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}), mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, - mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3, - libmariadbclient16 (<< 5.3.4) + mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3 Replaces: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}), mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3, diff --git a/debian/dist/Debian/mariadb-server-5.5.files b/debian/dist/Debian/mariadb-server-5.5.files index 2ea925fcaa7..e57752ec54a 100644 --- a/debian/dist/Debian/mariadb-server-5.5.files +++ b/debian/dist/Debian/mariadb-server-5.5.files @@ -15,6 +15,7 @@ usr/bin/aria_chk usr/bin/aria_dump_log usr/bin/mysql_convert_table_format usr/bin/mysql_install_db +usr/bin/mysql_plugin usr/bin/mysql_secure_installation usr/bin/mysql_setpermission usr/bin/mysql_tzinfo_to_sql diff --git a/debian/dist/Ubuntu/control b/debian/dist/Ubuntu/control index 7dd27754c97..fd72e8d4fb2 100644 --- a/debian/dist/Ubuntu/control +++ b/debian/dist/Ubuntu/control @@ -172,8 +172,7 @@ Depends: mariadb-client-5.5 (>= ${source:Version}), libdbi-perl, perl (>= 5.6), Provides: mariadb-server, mysql-server, virtual-mysql-server Conflicts: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}), mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, - mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3, - libmariadbclient16 (<< 5.3.4) + mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3 Replaces: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}), mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3, diff --git a/debian/dist/Ubuntu/mariadb-server-5.5.files b/debian/dist/Ubuntu/mariadb-server-5.5.files index 58da345b737..d08e6253fe8 100644 --- a/debian/dist/Ubuntu/mariadb-server-5.5.files +++ b/debian/dist/Ubuntu/mariadb-server-5.5.files @@ -17,6 +17,7 @@ usr/bin/aria_chk usr/bin/aria_dump_log usr/bin/mysql_convert_table_format usr/bin/mysql_install_db +usr/bin/mysql_plugin usr/bin/mysql_secure_installation usr/bin/mysql_setpermission usr/bin/mysql_tzinfo_to_sql From 3b85e2b57cc13c59a0afc0cd2c3d48379e275760 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Jan 2012 14:52:43 +0100 Subject: [PATCH 03/11] More 5.5 .deb packaging fixes --- debian/dist/Debian/rules | 3 +-- debian/dist/Ubuntu/rules | 3 +-- mysql-test/lib/mtr_cases.pm | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/debian/dist/Debian/rules b/debian/dist/Debian/rules index 11347164ea0..9994502ae1c 100755 --- a/debian/dist/Debian/rules +++ b/debian/dist/Debian/rules @@ -78,7 +78,7 @@ endif -DINSTALL_MANDIR=share/man \ \ -DMYSQL_SERVER_SUFFIX="-$(DEBVERSION)" \ - -DWITH_COMMENT="(MariaDB - http://mariadb.com/)" \ + -DCOMPILATION_COMMENT="mariadb.org binary distribution" \ -DSYSTEM_TYPE="debian-linux-gnu" \ -DINSTALL_LAYOUT=DEB \ \ @@ -86,7 +86,6 @@ endif -DWITH_FAST_MUTEXES=1 \ \ -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \ - -DMYSQL_USER=mysql \ \ -DEXTRA_CHARSETS=all \ -DWITH_LIBWRAP=1 \ diff --git a/debian/dist/Ubuntu/rules b/debian/dist/Ubuntu/rules index 564dad01ac0..99d0e49adc3 100755 --- a/debian/dist/Ubuntu/rules +++ b/debian/dist/Ubuntu/rules @@ -78,7 +78,7 @@ endif -DINSTALL_MANDIR=share/man \ \ -DMYSQL_SERVER_SUFFIX="-$(DEBVERSION)" \ - -DWITH_COMMENT="(MariaDB - http://mariadb.com/)" \ + -DCOMPILATION_COMMENT="mariadb.org binary distribution" \ -DSYSTEM_TYPE="debian-linux-gnu" \ -DINSTALL_LAYOUT=DEB \ \ @@ -86,7 +86,6 @@ endif -DWITH_FAST_MUTEXES=1 \ \ -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \ - -DMYSQL_USER=mysql \ \ -DEXTRA_CHARSETS=all \ -DWITH_LIBWRAP=1 \ diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index 3c8d3059713..3c91429f90c 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -278,6 +278,7 @@ sub collect_one_suite { $suitedir= my_find_dir($::basedir, ["share/mysql-test/suite", + "share/mysql/mysql-test/suite", "mysql-test/suite", "mysql-test", # Look in storage engine specific suite dirs From 59f5c05a387de0d3dadc85f8e2dfc68f24a255f5 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Tue, 24 Jan 2012 18:07:35 +0200 Subject: [PATCH 04/11] Don't crash with: UPDATE performance_schema.setup_instruments SET ENABLED="NO"; Don't log updates to performance schema in replication log. Ensure that we don't call ha_update after ha_index_or_rnd_end() is called on slave. .bzrignore: Ignore some generated files mysql-test/include/show_slave_status.inc: Ensure that ./ is removed from file names mysql-test/suite/perfschema/r/binlog_mix.result: Updated results mysql-test/suite/perfschema/r/binlog_row.result: Updated results mysql-test/suite/perfschema/r/binlog_stmt.result: Updated results mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result: Updated results mysql-test/suite/rpl/r/rpl_performance_schema.result: Ensure that we don't crash slave when we update performance schema mysql-test/suite/rpl/t/rpl_performance_schema.test: Ensure that we don't crash slave when we update performance schema sql/log_event.cc: Ensure that we don't call ha_update after ha_index_or_rnd_end() is called. Remove old code that is not needed anymore (like restarting read loop over all rows if no matcing row is found) Simplify code sql/log_event_old.cc: Ensure that we don't call ha_update after ha_index_or_rnd_end() is called. storage/myisam/ha_myisam.cc: More DBUG_PRINT storage/perfschema/ha_perfschema.h: Don't log updates to performance schema in replication log. --- .bzrignore | 2 + mysql-test/include/show_slave_status.inc | 1 + .../suite/perfschema/r/binlog_mix.result | 8 -- .../suite/perfschema/r/binlog_row.result | 8 -- .../suite/perfschema/r/binlog_stmt.result | 2 + .../rpl/r/rpl_cant_read_event_incident.result | 2 +- .../suite/rpl/r/rpl_performance_schema.result | 4 + .../suite/rpl/t/rpl_performance_schema.test | 10 +++ sql/log_event.cc | 82 +++++++------------ sql/log_event_old.cc | 25 +++--- storage/myisam/ha_myisam.cc | 13 ++- storage/perfschema/ha_perfschema.h | 8 +- 12 files changed, 80 insertions(+), 85 deletions(-) create mode 100644 mysql-test/suite/rpl/r/rpl_performance_schema.result create mode 100644 mysql-test/suite/rpl/t/rpl_performance_schema.test diff --git a/.bzrignore b/.bzrignore index b34267b09f4..d3aba366fbe 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1135,3 +1135,5 @@ plugin/handler_socket/perl-Net-HandlerSocket/Makefile.PL libmysqld/libmysqld_exports_file.cc libmysqld/gcalc_slicescan.cc libmysqld/gcalc_tools.cc +sql/share/errmsg.sys +sql/share/mysql diff --git a/mysql-test/include/show_slave_status.inc b/mysql-test/include/show_slave_status.inc index 67b1c987954..d04c6354386 100644 --- a/mysql-test/include/show_slave_status.inc +++ b/mysql-test/include/show_slave_status.inc @@ -69,6 +69,7 @@ while ($_show_slave_status_items) --let $_show_slave_status_name= `SELECT SUBSTRING_INDEX('$_show_slave_status_items', ',', 1)` --let $_show_slave_status_items= `SELECT LTRIM(SUBSTRING('$_show_slave_status_items', LENGTH('$_show_slave_status_name') + 2))` + --replace_regex /\.[\\\/]master/master/ --let $_show_slave_status_value= query_get_value(SHOW SLAVE STATUS, $_show_slave_status_name, 1) --let $_show_slave_status_value= `SELECT REPLACE("$_show_slave_status_value", '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')` --echo $_show_slave_status_name = '$_show_slave_status_value' diff --git a/mysql-test/suite/perfschema/r/binlog_mix.result b/mysql-test/suite/perfschema/r/binlog_mix.result index 3b2ab2bb435..97f76619619 100644 --- a/mysql-test/suite/perfschema/r/binlog_mix.result +++ b/mysql-test/suite/perfschema/r/binlog_mix.result @@ -26,10 +26,6 @@ update performance_schema.setup_instruments set enabled='YES' and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (performance_schema.setup_instruments) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by server */ master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id integer) @@ -44,7 +40,3 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (performance_schema.setup_instruments) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT diff --git a/mysql-test/suite/perfschema/r/binlog_row.result b/mysql-test/suite/perfschema/r/binlog_row.result index 644e5d58e23..1bcdb4a6c58 100644 --- a/mysql-test/suite/perfschema/r/binlog_row.result +++ b/mysql-test/suite/perfschema/r/binlog_row.result @@ -26,10 +26,6 @@ update performance_schema.setup_instruments set enabled='YES' and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (performance_schema.setup_instruments) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by server */ master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id integer) @@ -44,7 +40,3 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (performance_schema.setup_instruments) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT diff --git a/mysql-test/suite/perfschema/r/binlog_stmt.result b/mysql-test/suite/perfschema/r/binlog_stmt.result index 3fcecfdd1ca..1d18bd984b8 100644 --- a/mysql-test/suite/perfschema/r/binlog_stmt.result +++ b/mysql-test/suite/perfschema/r/binlog_stmt.result @@ -20,12 +20,14 @@ insert into test.t1 select thread_id from performance_schema.events_waits_current; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Mixing self-logging and non-self-logging engines in a statement is unsafe. insert into test.t2 select name from performance_schema.setup_instruments where name like "wait/synch/rwlock/sql/%" and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock"); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Mixing self-logging and non-self-logging engines in a statement is unsafe. drop table test.t1; drop table test.t2; update performance_schema.setup_instruments set enabled='YES' diff --git a/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result index c1b2c6e3195..1bee6f2ec1a 100644 --- a/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result +++ b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result @@ -11,7 +11,7 @@ reset slave; start slave; include/wait_for_slave_param.inc [Last_IO_Errno] Last_IO_Errno = '1236' -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the last event was read from './master-bin.000001' at 316, the last byte read was read from './master-bin.000001' at 335.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the last event was read from 'master-bin.000001' at 316, the last byte read was read from 'master-bin.000001' at 335.'' reset master; stop slave; reset slave; diff --git a/mysql-test/suite/rpl/r/rpl_performance_schema.result b/mysql-test/suite/rpl/r/rpl_performance_schema.result new file mode 100644 index 00000000000..ffda66c5bb9 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_performance_schema.result @@ -0,0 +1,4 @@ +include/master-slave.inc +[connection master] +UPDATE performance_schema.setup_instruments SET ENABLED="NO"; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_performance_schema.test b/mysql-test/suite/rpl/t/rpl_performance_schema.test new file mode 100644 index 00000000000..0562b0ea658 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_performance_schema.test @@ -0,0 +1,10 @@ +--source include/master-slave.inc +--source include/have_perfschema.inc +--source include/have_binlog_format_mixed.inc + +UPDATE performance_schema.setup_instruments SET ENABLED="NO"; + +--sync_slave_with_master +--source include/rpl_end.inc + +# End of test case diff --git a/sql/log_event.cc b/sql/log_event.cc index 816e4f4f38a..bd5f6306c47 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -10127,7 +10127,11 @@ void issue_long_find_row_warning(Log_event_type type, @note If the engine allows random access of the records, a combination of @c position() and @c rnd_pos() will be used. - */ + + Note that one MUST call ha_index_or_rnd_end() after this function if + it returns 0 as we must leave the row position in the handler intact + for any following update/delete command. +*/ int Rows_log_event::find_row(const Relay_log_info *rli) { @@ -10216,7 +10220,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli) { DBUG_PRINT("info",("ha_index_init returns error %d",error)); table->file->print_error(error, MYF(0)); - goto err; + goto end; } /* Fill key data for the row */ @@ -10251,7 +10255,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli) error= HA_ERR_KEY_NOT_FOUND; table->file->print_error(error, MYF(0)); table->file->ha_index_end(); - goto err; + goto end; } /* @@ -10281,15 +10285,15 @@ int Rows_log_event::find_row(const Relay_log_info *rli) /* Unique does not have non nullable part */ if (!(table->key_info->flags & (HA_NULL_PART_KEY))) { - table->file->ha_index_end(); - goto ok; + error= 0; + goto end; } else { KEY *keyinfo= table->key_info; /* - Unique has nullable part. We need to check if there is any field in the - BI image that is null and part of UNNI. + Unique has nullable part. We need to check if there is any + field in the BI image that is null and part of UNNI. */ bool null_found= FALSE; for (uint i=0; i < keyinfo->key_parts && !null_found; i++) @@ -10301,8 +10305,8 @@ int Rows_log_event::find_row(const Relay_log_info *rli) if (!null_found) { - table->file->ha_index_end(); - goto ok; + error= 0; + goto end; } /* else fall through to index scan */ @@ -10345,14 +10349,9 @@ int Rows_log_event::find_row(const Relay_log_info *rli) DBUG_PRINT("info",("no record matching the given row found")); table->file->print_error(error, MYF(0)); table->file->ha_index_end(); - goto err; + goto end; } } - - /* - Have to restart the scan to be able to fetch the next row. - */ - table->file->ha_index_end(); } else { @@ -10360,14 +10359,12 @@ int Rows_log_event::find_row(const Relay_log_info *rli) /* We use this to test that the correct key is used in test cases. */ DBUG_EXECUTE_IF("slave_crash_if_table_scan", abort();); - int restart_count= 0; // Number of times scanning has restarted from top - /* We don't have a key: search the table using rnd_next() */ if ((error= table->file->ha_rnd_init_with_error(1))) { DBUG_PRINT("info",("error initializing table scan" " (ha_rnd_init returns %d)",error)); - goto err; + goto end; } is_table_scan= true; @@ -10383,8 +10380,14 @@ int Rows_log_event::find_row(const Relay_log_info *rli) switch (error) { case 0: + DBUG_DUMP("record found", table->record[0], table->s->reclength); break; + case HA_ERR_END_OF_FILE: + DBUG_PRINT("info", ("Record not found")); + table->file->ha_rnd_end(); + goto end; + /* If the record was deleted, we pick the next one without doing any comparisons. @@ -10392,58 +10395,28 @@ int Rows_log_event::find_row(const Relay_log_info *rli) case HA_ERR_RECORD_DELETED: goto restart_rnd_next; - case HA_ERR_END_OF_FILE: - if (++restart_count < 2) - { - int error2; - if ((error2= table->file->ha_rnd_init_with_error(1))) - { - error= error2; - goto err; - } - } - break; - default: DBUG_PRINT("info", ("Failed to get next record" " (rnd_next returns %d)",error)); table->file->print_error(error, MYF(0)); table->file->ha_rnd_end(); - goto err; + goto end; } } - while (restart_count < 2 && record_compare(table)); + while (record_compare(table)); /* Note: above record_compare will take into accout all record fields which might be incorrect in case a partial row was given in the event */ - /* - Have to restart the scan to be able to fetch the next row. - */ - if (restart_count == 2) - DBUG_PRINT("info", ("Record not found")); - else - DBUG_DUMP("record found", table->record[0], table->s->reclength); - table->file->ha_rnd_end(); - DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == 0); - goto err; } -ok: + +end: if (is_table_scan || is_index_scan) issue_long_find_row_warning(get_type_code(), m_table->alias.c_ptr(), is_index_scan, rli); - - table->default_column_bitmaps(); - DBUG_RETURN(0); - -err: - if (is_table_scan || is_index_scan) - issue_long_find_row_warning(get_type_code(), m_table->alias.c_ptr(), - is_index_scan, rli); - table->default_column_bitmaps(); DBUG_RETURN(error); } @@ -10516,6 +10489,7 @@ int Delete_rows_log_event::do_exec_row(const Relay_log_info *const rli) Delete the record found, located in record[0] */ error= m_table->file->ha_delete_row(m_table->record[0]); + m_table->file->ha_index_or_rnd_end(); } return error; } @@ -10658,7 +10632,7 @@ Update_rows_log_event::do_exec_row(const Relay_log_info *const rli) m_curr_row= m_curr_row_end; /* this also updates m_curr_row_end */ if ((error= unpack_current_row(rli))) - return error; + goto err; /* Now we have the right row to update. The old row (the one we're @@ -10678,6 +10652,8 @@ Update_rows_log_event::do_exec_row(const Relay_log_info *const rli) if (error == HA_ERR_RECORD_IS_THE_SAME) error= 0; +err: + m_table->file->ha_index_or_rnd_end(); return error; } diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index 49d35197d60..09a58e29c18 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -2218,7 +2218,11 @@ Old_rows_log_event::write_row(const Relay_log_info *const rli, @note If the engine allows random access of the records, a combination of @c position() and @c rnd_pos() will be used. - */ + + Note that one MUST call ha_index_or_rnd_end() after this function if + it returns 0 as we must leave the row position in the handler intact + for any following update/delete command. +*/ int Old_rows_log_event::find_row(const Relay_log_info *rli) { @@ -2361,15 +2365,14 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli) /* Unique does not have non nullable part */ if (!(table->key_info->flags & (HA_NULL_PART_KEY))) { - table->file->ha_index_end(); DBUG_RETURN(0); } else { KEY *keyinfo= table->key_info; /* - Unique has nullable part. We need to check if there is any field in the - BI image that is null and part of UNNI. + Unique has nullable part. We need to check if there is any + field in the BI image that is null and part of UNNI. */ bool null_found= FALSE; for (uint i=0; i < keyinfo->key_parts && !null_found; i++) @@ -2381,7 +2384,6 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli) if (!null_found) { - table->file->ha_index_end(); DBUG_RETURN(0); } @@ -2424,11 +2426,6 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli) DBUG_RETURN(error); } } - - /* - Have to restart the scan to be able to fetch the next row. - */ - table->file->ha_index_end(); } else { @@ -2462,8 +2459,10 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli) if (++restart_count < 2) { int error2; + table->file->ha_rnd_end(); if ((error2= table->file->ha_rnd_init_with_error(1))) DBUG_RETURN(error2); + goto restart_rnd_next; } break; @@ -2489,7 +2488,8 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli) DBUG_PRINT("info", ("Record not found")); else DBUG_DUMP("record found", table->record[0], table->s->reclength); - table->file->ha_rnd_end(); + if (error) + table->file->ha_rnd_end(); DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == 0); DBUG_RETURN(error); @@ -2738,6 +2738,7 @@ int Delete_rows_log_event_old::do_exec_row(const Relay_log_info *const rli) Delete the record found, located in record[0] */ error= m_table->file->ha_delete_row(m_table->record[0]); + m_table->file->ha_index_or_rnd_end(); } return error; } @@ -2874,6 +2875,8 @@ Update_rows_log_event_old::do_exec_row(const Relay_log_info *const rli) #endif error= m_table->file->ha_update_row(m_table->record[1], m_table->record[0]); + m_table->file->ha_index_or_rnd_end(); + if (error == HA_ERR_RECORD_IS_THE_SAME) error= 0; diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 86d80b14ce5..9e92e9c6262 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -1672,18 +1672,26 @@ int ha_myisam::index_init(uint idx, bool sorted) int ha_myisam::index_end() { + DBUG_ENTER("ha_myisam::index_end"); active_index=MAX_KEY; //pushed_idx_cond_keyno= MAX_KEY; mi_set_index_cond_func(file, NULL, 0); in_range_check_pushed_down= FALSE; ds_mrr.dsmrr_close(); - return 0; +#if !defined(DBUG_OFF) && defined(SQL_SELECT_FIXED_FOR_UPDATE) + file->update&= ~HA_STATE_AKTIV; // Forget active row +#endif + DBUG_RETURN(0); } int ha_myisam::rnd_end() { + DBUG_ENTER("ha_myisam::rnd_end"); ds_mrr.dsmrr_close(); - return 0; +#if !defined(DBUG_OFF) && defined(SQL_SELECT_FIXED_FOR_UPDATE) + file->update&= ~HA_STATE_AKTIV; // Forget active row +#endif + DBUG_RETURN(0); } int ha_myisam::index_read_map(uchar *buf, const uchar *key, @@ -1785,6 +1793,7 @@ void ha_myisam::position(const uchar *record) { my_off_t row_position= mi_position(file); my_store_ptr(ref, ref_length, row_position); + file->update|= HA_STATE_AKTIV; // Row can be updated } int ha_myisam::info(uint flag) diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h index 9557bc25b6e..17ab601e60f 100644 --- a/storage/perfschema/ha_perfschema.h +++ b/storage/perfschema/ha_perfschema.h @@ -70,9 +70,13 @@ public: Without HA_FAST_KEY_READ, the optimizer reads all columns and never calls ::rnd_pos(), so it is guaranteed to return only thread records. + We use HA_HAS_OWN_BINLOGGING to stop changes to this table to + be logged to slaves (as enabled performance tracking on all slaves + is probably not what anyone wants) */ - return HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_NO_AUTO_INCREMENT | - HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_NO_BLOBS; + return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_NO_AUTO_INCREMENT | + HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | + HA_HAS_OWN_BINLOGGING | HA_NO_BLOBS); } /** From cff7a9861a32c82ef51d18f42a09337399257db7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 25 Jan 2012 13:39:54 +0100 Subject: [PATCH 05/11] Add missing include and library files to libmariadbclient-dev package. --- debian/dist/Debian/rules | 4 +++- debian/dist/Ubuntu/rules | 4 +++- debian/libmariadbclient-dev.files | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/dist/Debian/rules b/debian/dist/Debian/rules index 9994502ae1c..06b5b108e10 100755 --- a/debian/dist/Debian/rules +++ b/debian/dist/Debian/rules @@ -73,7 +73,7 @@ endif -DCMAKE_INSTALL_PREFIX=/usr \ -DINSTALL_SBINDIR=sbin \ -DMYSQL_DATADIR=/var/lib/mysql \ - -DINSTALL_INCLUDEDIR=include \ + -DINSTALL_INCLUDEDIR=include/mysql \ -DINSTALL_INFODIR=share/info \ -DINSTALL_MANDIR=share/man \ \ @@ -169,6 +169,8 @@ install: build # libmysqlclient-dev: forgotten header file since 3.23.25? cp $(BUILDDIR)/include/my_config.h $(TMP)/usr/include/mysql/ cp include/my_dir.h $(TMP)/usr/include/mysql/ + mv $(TMP)/usr/include/mysql/mysql/*.h $(TMP)/usr/include/mysql/ + mv $(TMP)/usr/include/mysql/mysql/psi $(TMP)/usr/include/mysql/ # mysql-common: We now provide our own config file. # can't be mariadb-common, other packages insist diff --git a/debian/dist/Ubuntu/rules b/debian/dist/Ubuntu/rules index 99d0e49adc3..2446566fd3f 100755 --- a/debian/dist/Ubuntu/rules +++ b/debian/dist/Ubuntu/rules @@ -73,7 +73,7 @@ endif -DCMAKE_INSTALL_PREFIX=/usr \ -DINSTALL_SBINDIR=sbin \ -DMYSQL_DATADIR=/var/lib/mysql \ - -DINSTALL_INCLUDEDIR=include \ + -DINSTALL_INCLUDEDIR=include/mysql \ -DINSTALL_INFODIR=share/info \ -DINSTALL_MANDIR=share/man \ \ @@ -169,6 +169,8 @@ install: build # libmysqlclient-dev: forgotten header file since 3.23.25? cp $(BUILDDIR)/include/my_config.h $(TMP)/usr/include/mysql/ cp include/my_dir.h $(TMP)/usr/include/mysql/ + mv $(TMP)/usr/include/mysql/mysql/*.h $(TMP)/usr/include/mysql/ + mv $(TMP)/usr/include/mysql/mysql/psi $(TMP)/usr/include/mysql/ # mysql-common: We now provide our own config file. # can't be mariadb-common, other packages insist diff --git a/debian/libmariadbclient-dev.files b/debian/libmariadbclient-dev.files index 42a6c748b88..f75f049ec00 100644 --- a/debian/libmariadbclient-dev.files +++ b/debian/libmariadbclient-dev.files @@ -1,6 +1,8 @@ usr/bin/mysql_config usr/include/mysql/*.h +usr/include/mysql/psi/*.h usr/lib/libmysqlclient.a usr/lib/libmysqlclient_r.a +usr/lib/libmysqlservices.a usr/share/aclocal/mysql.m4 usr/share/man/man1/mysql_config.1 From 7ffa6f4d06370aa0d8de24e8a55b30c86ca7c595 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 25 Jan 2012 21:23:14 +0100 Subject: [PATCH 06/11] Always define UT_DBG_ABORT in innodb/xtradb, also on Windows. This will avoid endless hangs inside ut_dgb_stop_thread --- storage/innobase/include/ut0dbg.h | 12 +++++++----- storage/xtradb/include/ut0dbg.h | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/storage/innobase/include/ut0dbg.h b/storage/innobase/include/ut0dbg.h index 07730176d81..ce6dcb63049 100644 --- a/storage/innobase/include/ut0dbg.h +++ b/storage/innobase/include/ut0dbg.h @@ -55,11 +55,9 @@ ut_dbg_assertion_failed( ulint line) /*!< in: line number of the assertion */ UNIV_COLD __attribute__((nonnull(2))); -#if defined(__WIN__) || defined(__INTEL_COMPILER) -# undef UT_DBG_USE_ABORT -#elif defined(__GNUC__) && (__GNUC__ > 2) -# define UT_DBG_USE_ABORT -#endif + +#define UT_DBG_USE_ABORT + #ifndef UT_DBG_USE_ABORT /** A null pointer that will be dereferenced to trigger a memory trap */ @@ -83,7 +81,11 @@ ut_dbg_stop_thread( #ifdef UT_DBG_USE_ABORT /** Abort the execution. */ +#ifdef _WIN32 +# define UT_DBG_PANIC __debugbreak() +#else # define UT_DBG_PANIC abort() +#endif /** Stop threads (null operation) */ # define UT_DBG_STOP do {} while (0) #else /* UT_DBG_USE_ABORT */ diff --git a/storage/xtradb/include/ut0dbg.h b/storage/xtradb/include/ut0dbg.h index 07730176d81..ce6dcb63049 100644 --- a/storage/xtradb/include/ut0dbg.h +++ b/storage/xtradb/include/ut0dbg.h @@ -55,11 +55,9 @@ ut_dbg_assertion_failed( ulint line) /*!< in: line number of the assertion */ UNIV_COLD __attribute__((nonnull(2))); -#if defined(__WIN__) || defined(__INTEL_COMPILER) -# undef UT_DBG_USE_ABORT -#elif defined(__GNUC__) && (__GNUC__ > 2) -# define UT_DBG_USE_ABORT -#endif + +#define UT_DBG_USE_ABORT + #ifndef UT_DBG_USE_ABORT /** A null pointer that will be dereferenced to trigger a memory trap */ @@ -83,7 +81,11 @@ ut_dbg_stop_thread( #ifdef UT_DBG_USE_ABORT /** Abort the execution. */ +#ifdef _WIN32 +# define UT_DBG_PANIC __debugbreak() +#else # define UT_DBG_PANIC abort() +#endif /** Stop threads (null operation) */ # define UT_DBG_STOP do {} while (0) #else /* UT_DBG_USE_ABORT */ From 6f142ee51c86032b14b89252ffbe9b44e4d677a7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 Jan 2012 13:38:42 +0100 Subject: [PATCH 07/11] Remove --plugin-dir option from mysql_client_test test case. This gives the wrong path when testing installed server, and we set the correct path in my.cnf anyway. --- mysql-test/t/mysql_client_test.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index 7b689a751df..90da022fb38 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -14,7 +14,7 @@ SET @old_slow_query_log= @@global.slow_query_log; # var/log/mysql_client_test.trace --exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 ---exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M --plugin-dir=$MYSQLTEST_VARDIR/plugins >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 +--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 # End of 4.1 tests echo ok; From 438ed0408c69faa9e5c4c026e24ef52eac62f08e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 Jan 2012 12:55:12 +0100 Subject: [PATCH 08/11] .deb packaging fixes: make mariadb-common a real package, which depends on mysql-common and places mariadb-specific stuff in /etc/mysql/conf.d/mariadb.cnf. This should allow to co-exist with default Debian mysql-common package and help resolve dependencies when installing mariadb among multiple available versions of MySQL from different repositories. --- debian/additions/mariadb.cnf | 36 ++++++++++++++++++++++++++++++++++ debian/additions/my.cnf | 38 ------------------------------------ debian/dist/Debian/control | 16 +++++++++++---- debian/dist/Debian/rules | 9 +++++++-- debian/dist/Ubuntu/control | 16 +++++++++++---- debian/dist/Ubuntu/rules | 9 +++++++-- debian/mariadb-common.files | 1 + debian/mariadb-common.postrm | 8 ++++++++ 8 files changed, 83 insertions(+), 50 deletions(-) create mode 100644 debian/additions/mariadb.cnf create mode 100644 debian/mariadb-common.files create mode 100644 debian/mariadb-common.postrm diff --git a/debian/additions/mariadb.cnf b/debian/additions/mariadb.cnf new file mode 100644 index 00000000000..12db9581469 --- /dev/null +++ b/debian/additions/mariadb.cnf @@ -0,0 +1,36 @@ +# MariaDB-specific config file. +# Read by /etc/mysql/my.cnf + +[client] +# Default is Latin1, if you need UTF-8 set this (also in server section) +#default-character-set = utf8 + +[mysqld] +# +# * Character sets +# +# Default is Latin1, if you need UTF-8 set all this (also in client section) +# +#default-character-set = utf8 +#default-collation = utf8_general_ci +#character_set_server = utf8 +#collation_server = utf8_general_ci +# +# * Fine Tuning +# +max_connections = 100 +connect_timeout = 5 +wait_timeout = 600 +sort_buffer_size = 4M +bulk_insert_buffer_size = 16M +tmp_table_size = 32M +max_heap_table_size = 32M +# +# * MyISAM +# +key_buffer_size = 128M +table_cache = 400 +myisam_sort_buffer_size = 512M +concurrent_insert = 2 +read_buffer_size = 2M +read_rnd_buffer_size = 1M diff --git a/debian/additions/my.cnf b/debian/additions/my.cnf index 1a176cc1dc1..ed19dcf5fc9 100644 --- a/debian/additions/my.cnf +++ b/debian/additions/my.cnf @@ -1,19 +1,5 @@ # MariaDB database server configuration file. # -# ================================================================= -# Base configuration courtesy of Open Query (http://openquery.com/) -# For production use, case-specific preparation is still required. -# 2009-10-07 -# -# This is *not* an optimised config, merely a more sane baseline: -# - InnoDB default (e.g., ACID out-of-the-box, same as on Windows) -# - strict mode (for proper input checks, same as on Windows) -# - various other useful settings -# - make use of MariaDB/Percona/OurDelta enhancements/extensions -# -# For tuning assistance, please see http://openquery.com/services -# ================================================================= -# # You can copy this file to one of: # - "/etc/mysql/my.cnf" to set global options, # - "~/.my.cnf" to set user-specific options. @@ -32,8 +18,6 @@ [client] port = 3306 socket = /var/run/mysqld/mysqld.sock -# Default is Latin1, if you need UTF-8 set this (also in server section) -#default-character-set = utf8 # Here is entries for some specific programs # The following values assume you have at least 32M ram @@ -58,43 +42,21 @@ lc_messages_dir = /usr/share/mysql lc_messages = en_US skip-external-locking # -# * Character sets -# -# Default is Latin1, if you need UTF-8 set all this (also in client section) -# -#default-character-set = utf8 -#default-collation = utf8_general_ci -#character_set_server = utf8 -#collation_server = utf8_general_ci -# # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. bind-address = 127.0.0.1 # # * Fine Tuning # -max_connections = 100 -connect_timeout = 5 -wait_timeout = 600 max_allowed_packet = 16M thread_cache_size = 128 -sort_buffer_size = 4M -bulk_insert_buffer_size = 16M -tmp_table_size = 32M -max_heap_table_size = 32M # # * MyISAM # # This replaces the startup script and checks MyISAM tables if needed # the first time they are touched. On error, make copy and try a repair. myisam_recover = BACKUP -key_buffer_size = 128M #open-files-limit = 2000 -table_cache = 400 -myisam_sort_buffer_size = 512M -concurrent_insert = 2 -read_buffer_size = 2M -read_rnd_buffer_size = 1M # # * Query Cache Configuration # diff --git a/debian/dist/Debian/control b/debian/dist/Debian/control index 7de203fd3f0..562459618ec 100644 --- a/debian/dist/Debian/control +++ b/debian/dist/Debian/control @@ -71,7 +71,6 @@ Package: mysql-common Section: database Architecture: all Depends: ${shlibs:Depends}, ${misc:Depends} -Provides: mariadb-common Description: MariaDB database common files (e.g. /etc/mysql/my.cnf) MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -80,10 +79,19 @@ Description: MariaDB database common files (e.g. /etc/mysql/my.cnf) . This package includes files needed by all versions of the client library (e.g. /etc/mysql/my.cnf). + +Package: mariadb-common +Section: database +Architecture: all +Depends: mysql-common, ${shlibs:Depends}, ${misc:Depends} +Description: MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf) + MariaDB is a fast, stable and true multi-user, multi-threaded SQL database + server. SQL (Structured Query Language) is the most popular database query + language in the world. The main goals of MariaDB are speed, robustness and + ease of use. . - Due to libmysqlclient15off package depends, this package has not yet been - renamed to mariadb-common. It does, however, already contain a new my.cnf - file with mariadb-specific configuration options. + This package includes files needed by all versions of the client library + (e.g. /etc/mysql/conf.d/mariadb.cnf). Package: mariadb-client-core-5.5 Architecture: any diff --git a/debian/dist/Debian/rules b/debian/dist/Debian/rules index 06b5b108e10..3c060c99c88 100755 --- a/debian/dist/Debian/rules +++ b/debian/dist/Debian/rules @@ -172,11 +172,16 @@ install: build mv $(TMP)/usr/include/mysql/mysql/*.h $(TMP)/usr/include/mysql/ mv $(TMP)/usr/include/mysql/mysql/psi $(TMP)/usr/include/mysql/ - # mysql-common: We now provide our own config file. - # can't be mariadb-common, other packages insist + # mysql-common: We provide our own version of this package for + # completeness, but we can use an existing version; mariadb-specic + # stuff is in mariadb-common install -d $(TMP)/etc/mysql install -m 0644 debian/additions/my.cnf $(TMP)/etc/mysql/my.cnf + # mariadb-common: MariaDB-specific config stuff. + install -d $(TMP)/etc/mysql/conf.d + install -m 0644 debian/additions/mariadb.cnf $(TMP)/etc/mysql/conf.d/mariadb.cnf + # mariadb-client install -m 0755 debian/additions/mysqlreport $(TMP)/usr/bin/ install -m 0755 debian/additions/innotop/innotop $(TMP)/usr/bin/ diff --git a/debian/dist/Ubuntu/control b/debian/dist/Ubuntu/control index fd72e8d4fb2..8594ee9616b 100644 --- a/debian/dist/Ubuntu/control +++ b/debian/dist/Ubuntu/control @@ -71,7 +71,6 @@ Package: mysql-common Section: database Architecture: all Depends: ${shlibs:Depends}, ${misc:Depends} -Provides: mariadb-common Description: MariaDB database common files (e.g. /etc/mysql/my.cnf) MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -80,10 +79,19 @@ Description: MariaDB database common files (e.g. /etc/mysql/my.cnf) . This package includes files needed by all versions of the client library (e.g. /etc/mysql/my.cnf). + +Package: mariadb-common +Section: database +Architecture: all +Depends: mysql-common, ${shlibs:Depends}, ${misc:Depends} +Description: MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf) + MariaDB is a fast, stable and true multi-user, multi-threaded SQL database + server. SQL (Structured Query Language) is the most popular database query + language in the world. The main goals of MariaDB are speed, robustness and + ease of use. . - Due to libmysqlclient15off package depends, this package has not yet been - renamed to mariadb-common. It does, however, already contain a new my.cnf - file with mariadb-specific configuration options. + This package includes files needed by all versions of the client library + (e.g. /etc/mysql/conf.d/mariadb.cnf). Package: mariadb-client-core-5.5 Architecture: any diff --git a/debian/dist/Ubuntu/rules b/debian/dist/Ubuntu/rules index 2446566fd3f..f0ece68641d 100755 --- a/debian/dist/Ubuntu/rules +++ b/debian/dist/Ubuntu/rules @@ -172,11 +172,16 @@ install: build mv $(TMP)/usr/include/mysql/mysql/*.h $(TMP)/usr/include/mysql/ mv $(TMP)/usr/include/mysql/mysql/psi $(TMP)/usr/include/mysql/ - # mysql-common: We now provide our own config file. - # can't be mariadb-common, other packages insist + # mysql-common: We provide our own version of this package for + # completeness, but we can use an existing version; mariadb-specic + # stuff is in mariadb-common install -d $(TMP)/etc/mysql install -m 0644 debian/additions/my.cnf $(TMP)/etc/mysql/my.cnf + # mariadb-common: MariaDB-specific config stuff. + install -d $(TMP)/etc/mysql/conf.d + install -m 0644 debian/additions/mariadb.cnf $(TMP)/etc/mysql/conf.d/mariadb.cnf + # mariadb-client install -m 0755 debian/additions/mysqlreport $(TMP)/usr/bin/ install -m 0755 debian/additions/innotop/innotop $(TMP)/usr/bin/ diff --git a/debian/mariadb-common.files b/debian/mariadb-common.files new file mode 100644 index 00000000000..f37e46c45fe --- /dev/null +++ b/debian/mariadb-common.files @@ -0,0 +1 @@ +etc/mysql/conf.d/mariadb.cnf diff --git a/debian/mariadb-common.postrm b/debian/mariadb-common.postrm new file mode 100644 index 00000000000..027592f816e --- /dev/null +++ b/debian/mariadb-common.postrm @@ -0,0 +1,8 @@ +#!/bin/bash -e + +if [ "$1" = "purge" ]; then + rmdir /etc/mysql/conf.d 2>/dev/null || true + rmdir /etc/mysql 2>/dev/null || true +fi + +#DEBHELPER# From 66a64adb3e97cb13bdbedb24168e231840f14c55 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 26 Jan 2012 16:06:08 +0100 Subject: [PATCH 09/11] Xtradb recently started to access thd members directly ,e.g thd->stmt_da (ha_innodb.cc) It needs recompilation for embedded server, as layout of THD is different in embedded. --- storage/xtradb/CMakeLists.txt | 2 +- storage/xtradb/handler/handler0alter.cc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt index 044a259c65d..1d2b0b29dea 100644 --- a/storage/xtradb/CMakeLists.txt +++ b/storage/xtradb/CMakeLists.txt @@ -266,4 +266,4 @@ IF(WITH_INNODB) ENDIF() MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE DEFAULT - LINK_LIBRARIES ${ZLIB_LIBRARY}) + LINK_LIBRARIES ${ZLIB_LIBRARY} RECOMPILE_FOR_EMBEDDED) diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc index 9d6ccaf99a2..2fd05901393 100644 --- a/storage/xtradb/handler/handler0alter.cc +++ b/storage/xtradb/handler/handler0alter.cc @@ -23,6 +23,7 @@ Smart ALTER TABLE #include #include +#include #include // SQLCOM_CREATE_INDEX #include From 7b3469862c7f486bab41012767e2666614e47569 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 26 Jan 2012 16:55:40 +0100 Subject: [PATCH 10/11] Fix a few failing tests on win2008r2-vs2010-amd64-debug --- mysql-test/include/wait_until_connected_again.inc | 2 +- mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result | 4 ++-- mysql-test/suite/funcs_1/r/processlist_priv_ps.result | 4 ++-- mysql-test/suite/sys_vars/t/completion_type_func.test | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mysql-test/include/wait_until_connected_again.inc b/mysql-test/include/wait_until_connected_again.inc index aff92141a8b..96240e36db7 100644 --- a/mysql-test/include/wait_until_connected_again.inc +++ b/mysql-test/include/wait_until_connected_again.inc @@ -14,7 +14,7 @@ while ($mysql_errno) # Strangely enough, the server might return "Too many connections" # while being shutdown, thus 1040 is an "allowed" error # See BUG#36228 - --error 0,1040,1053,2002,2003,2006,2013 + --error 0,1040,1053,2002,2003,2005,2006,2013 show status; dec $counter; diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result index 4d7ccd554ca..d99e7f06295 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result @@ -205,7 +205,7 @@ def mysql user Lock_tables_priv 21 N NO enum 1 3 NULL NULL NULL utf8 utf8_genera def mysql user max_connections 39 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned def mysql user max_questions 37 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned -def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned +def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) def mysql user Password 3 NO char 41 41 NULL NULL NULL latin1 latin1_bin char(41) def mysql user plugin 41 NO char 64 64 NULL NULL NULL latin1 latin1_swedish_ci char(64) def mysql user Process_priv 12 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') @@ -515,6 +515,6 @@ NULL mysql time_zone_transition_type Is_DST tinyint NULL NULL NULL NULL tinyint( NULL mysql user max_questions int NULL NULL NULL NULL int(11) unsigned NULL mysql user max_updates int NULL NULL NULL NULL int(11) unsigned NULL mysql user max_connections int NULL NULL NULL NULL int(11) unsigned -NULL mysql user max_user_connections int NULL NULL NULL NULL int(11) unsigned +NULL mysql user max_user_connections int NULL NULL NULL NULL int(11) 1.0000 mysql user plugin char 64 64 latin1 latin1_swedish_ci char(64) 1.0000 mysql user authentication_string text 65535 65535 utf8 utf8_bin text diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result index 42cd98f63a6..421636f3d92 100644 --- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result +++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result @@ -85,7 +85,7 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_ DROP DATABASE information_schema; ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' RENAME DATABASE information_schema TO info_schema; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATABASE information_schema TO info_schema' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DATABASE information_schema TO info_schema' at line 1 ALTER DATABASE information_schema UPGRADE DATA DIRECTORY NAME; ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' #################################################################################### @@ -154,7 +154,7 @@ ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'in DROP DATABASE information_schema; ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' RENAME DATABASE information_schema TO info_schema; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATABASE information_schema TO info_schema' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DATABASE information_schema TO info_schema' at line 1 ALTER DATABASE information_schema UPGRADE DATA DIRECTORY NAME; ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'information_schema' #################################################################################### diff --git a/mysql-test/suite/sys_vars/t/completion_type_func.test b/mysql-test/suite/sys_vars/t/completion_type_func.test index 9495a8e118c..6b1aa6a29cd 100644 --- a/mysql-test/suite/sys_vars/t/completion_type_func.test +++ b/mysql-test/suite/sys_vars/t/completion_type_func.test @@ -156,7 +156,7 @@ COMMIT; --echo ## Inserting rows should give error here because connection should ## --echo ## disconnect after using COMMIT ## ---Error 2006,2013,ER_QUERY_INTERRUPTED +--Error 2006,2013,ER_QUERY_INTERRUPTED,ER_CONNECTION_KILLED INSERT INTO t1 VALUES(4,'Record_4'); --echo switch to connection test_con2 @@ -171,7 +171,7 @@ INSERT INTO t1 VALUES(12,'Record_12'); ROLLBACK; --echo ## Expect a failure due to COMMIT/ROLLBACK AND RELEASE behavior ## ---Error 2006,2013,ER_QUERY_INTERRUPTED +--Error 2006,2013,ER_QUERY_INTERRUPTED,ER_CONNECTION_KILLED INSERT INTO t1 VALUES(4,'Record_4'); connection default; From 2551e1ae3306cdab1521b34722b46d6f929bd92b Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 26 Jan 2012 17:10:30 +0100 Subject: [PATCH 11/11] yet another attempt to fix rpl_corruption test --- mysql-test/suite/rpl/t/rpl_corruption.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/rpl/t/rpl_corruption.test b/mysql-test/suite/rpl/t/rpl_corruption.test index 70322197317..458e3f10e67 100644 --- a/mysql-test/suite/rpl/t/rpl_corruption.test +++ b/mysql-test/suite/rpl/t/rpl_corruption.test @@ -115,7 +115,7 @@ SET GLOBAL master_verify_checksum=0; SET GLOBAL debug_dbug="+d,corrupt_read_log_event2"; --connection slave START SLAVE IO_THREAD; -let $slave_io_errno= 1595,1722; +let $slave_io_errno= 1595,1722,1923; --source include/wait_for_slave_io_error.inc --connection master SET GLOBAL debug_dbug="-d,corrupt_read_log_event2"; @@ -127,7 +127,7 @@ SET GLOBAL master_verify_checksum=1; --connection slave SET GLOBAL debug_dbug="+d,corrupt_queue_event"; START SLAVE IO_THREAD; -let $slave_io_errno= 1595,1722; +let $slave_io_errno= 1595,1722,1923; --source include/wait_for_slave_io_error.inc SET GLOBAL debug_dbug="-d,corrupt_queue_event";