diff --git a/mysql-test/r/archive_plugin.result b/mysql-test/r/archive_plugin.result index 221b343cca5..90c1f10bf19 100644 --- a/mysql-test/r/archive_plugin.result +++ b/mysql-test/r/archive_plugin.result @@ -10,6 +10,9 @@ UNINSTALL PLUGIN archive; INSTALL PLUGIN archive SONAME 'ha_archive.so'; CREATE TABLE t1(a int) ENGINE=ARCHIVE; DROP TABLE t1; +SELECT 1; +1 +1 UNINSTALL PLUGIN archive; UNINSTALL PLUGIN archive; ERROR 42000: PLUGIN archive does not exist diff --git a/mysql-test/r/blackhole_plugin.result b/mysql-test/r/blackhole_plugin.result index 9fc0cacd9cc..4ef9fa0fa47 100644 --- a/mysql-test/r/blackhole_plugin.result +++ b/mysql-test/r/blackhole_plugin.result @@ -10,6 +10,9 @@ UNINSTALL PLUGIN blackhole; INSTALL PLUGIN blackhole SONAME 'ha_blackhole.so'; CREATE TABLE t1(a int) ENGINE=BLACKHOLE; DROP TABLE t1; +SELECT 1; +1 +1 UNINSTALL PLUGIN blackhole; UNINSTALL PLUGIN blackhole; ERROR 42000: PLUGIN blackhole does not exist diff --git a/mysql-test/r/func_analyse.result b/mysql-test/r/func_analyse.result index 1820782d2f8..92fc26e7ba3 100644 --- a/mysql-test/r/func_analyse.result +++ b/mysql-test/r/func_analyse.result @@ -123,3 +123,16 @@ CREATE TABLE t2 SELECT 1 FROM t1, t1 t3 GROUP BY t3.a PROCEDURE ANALYSE(); ERROR HY000: Incorrect usage of PROCEDURE and non-SELECT DROP TABLE t1; End of 5.0 tests +# +# Bug#11765202: Dbug_violation_helper::~Dbug_violation_helper(): Assertion `!_entered' failed. +# +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (a VARCHAR(2) CHARSET UTF8 NOT NULL); +INSERT INTO t1 VALUES ('e'),('e'),('e-'); +SELECT * FROM t1 PROCEDURE ANALYSE(); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t1.a e e- 1 2 0 0 1.3333 NULL ENUM('e','e-') NOT NULL +DROP TABLE t1; +End of 5.1 tests diff --git a/mysql-test/t/archive_plugin.test b/mysql-test/t/archive_plugin.test index 567a0a58ce7..7d9b0ea065f 100644 --- a/mysql-test/t/archive_plugin.test +++ b/mysql-test/t/archive_plugin.test @@ -20,6 +20,14 @@ CREATE TABLE t1(a int) ENGINE=ARCHIVE; DROP TABLE t1; +# This dummy statement is required for --ps-protocol mode. +# The thing is that last prepared statement is "cached" in mysqltest.cc +# (unless "reconnect" is enabled, and that's not the case here). +# This statement forces mysqltest.cc to close prepared "DROP TABLE t1". +# Otherwise, the plugin can not be uninstalled because there is an active +# prepared statement using it. +SELECT 1; + UNINSTALL PLUGIN archive; --error ER_SP_DOES_NOT_EXIST diff --git a/mysql-test/t/blackhole_plugin.test b/mysql-test/t/blackhole_plugin.test index 1de5b2d0499..448104bed2b 100644 --- a/mysql-test/t/blackhole_plugin.test +++ b/mysql-test/t/blackhole_plugin.test @@ -20,6 +20,14 @@ CREATE TABLE t1(a int) ENGINE=BLACKHOLE; DROP TABLE t1; +# This dummy statement is required for --ps-protocol mode. +# The thing is that last prepared statement is "cached" in mysqltest.cc +# (unless "reconnect" is enabled, and that's not the case here). +# This statement forces mysqltest.cc to close prepared "DROP TABLE t1". +# Otherwise, the plugin can not be uninstalled because there is an active +# prepared statement using it. +SELECT 1; + UNINSTALL PLUGIN blackhole; --error ER_SP_DOES_NOT_EXIST UNINSTALL PLUGIN blackhole; diff --git a/mysql-test/t/file_contents.test b/mysql-test/t/file_contents.test index 2a112e14495..33cd65fb2b4 100644 --- a/mysql-test/t/file_contents.test +++ b/mysql-test/t/file_contents.test @@ -10,9 +10,10 @@ --perl print "\nChecking 'INFO_SRC' and 'INFO_BIN'\n"; -$dir_docs = $ENV{'MYSQL_BINDIR'}; -if($dir_docs =~ m|/usr/|) { +$dir_bin = $ENV{'MYSQL_BINDIR'}; +if ($dir_bin =~ m|/usr/|) { # RPM package + $dir_docs = $dir_bin; $dir_docs =~ s|/lib|/share/doc|; if(-d "$dir_docs/packages/MySQL-server") { # SuSE @@ -21,8 +22,19 @@ if($dir_docs =~ m|/usr/|) { # RedHat: version number in directory name $dir_docs = glob "$dir_docs/MySQL-server*"; } +} elsif ($dir_bin =~ m|/usr$|) { + # RPM build during development + $dir_docs = "$dir_bin/share/doc"; + if(-d "$dir_docs/packages/MySQL-server") { + # SuSE + $dir_docs = "$dir_docs/packages/MySQL-server"; + } else { + # RedHat: version number in directory name + $dir_docs = glob "$dir_docs/MySQL-server*"; + } } else { # tar.gz package, Windows, or developer work (in BZR) + $dir_docs = $dir_bin; $dir_docs =~ s|/lib||; if(-d "$dir_docs/docs") { $dir_docs = "$dir_docs/docs"; # package @@ -32,7 +44,7 @@ if($dir_docs =~ m|/usr/|) { } $found_version = "No line 'MySQL source #.#.#'"; $found_revision = "No line 'revision-id: .....'"; -open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs'\n"; +open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs' (starting from bindir '$dir_bin')\n"; while(defined ($line = )) { if ($line =~ m|^MySQL source \d\.\d\.\d+|) {$found_version = "Found MySQL version number";} if ($line =~ m|^revision-id: .*@.*-2\d{13}-\w+$|) {$found_revision = "Found BZR revision id";} @@ -41,7 +53,7 @@ close I_SRC; print "INFO_SRC: $found_version / $found_revision\n"; $found_compiler = "No line about compiler information"; $found_features = "No line 'Feature flags'"; -open(I_BIN,"<","$dir_docs/INFO_BIN") or print "Cannot open 'INFO_BIN' in '$dir_docs'\n"; +open(I_BIN,"<","$dir_docs/INFO_BIN") or print "Cannot open 'INFO_BIN' in '$dir_docs' (starting from bindir '$dir_bin')\n"; while(defined ($line = )) { # "generator" on Windows, "flags" on Unix: if (($line =~ m| Compiler / generator used: |) || diff --git a/mysql-test/t/func_analyse.test b/mysql-test/t/func_analyse.test index 05f739bfd69..63929d8766b 100644 --- a/mysql-test/t/func_analyse.test +++ b/mysql-test/t/func_analyse.test @@ -133,3 +133,15 @@ DROP TABLE t1; --echo End of 5.0 tests + +--echo # +--echo # Bug#11765202: Dbug_violation_helper::~Dbug_violation_helper(): Assertion `!_entered' failed. +--echo # + +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a VARCHAR(2) CHARSET UTF8 NOT NULL); +INSERT INTO t1 VALUES ('e'),('e'),('e-'); +SELECT * FROM t1 PROCEDURE ANALYSE(); +DROP TABLE t1; + +--echo End of 5.1 tests diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 53f82e02e97..24ce134b40d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4656,10 +4656,15 @@ int mysqld_main(int argc, char **argv) #if defined(__WIN__) && !defined(EMBEDDED_LIBRARY) int mysql_service(void *p) { + if (my_thread_init()) + return 1; + if (use_opt_args) win_main(opt_argc, opt_argv); else win_main(Service.my_argc, Service.my_argv); + + my_thread_end(); return 0; } diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index e3c0ed28052..b070768a7b6 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -242,7 +242,7 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len) if (str == end) { info->is_float = 1; // we can't use variable decimals here - return 1; + DBUG_RETURN(1); } DBUG_RETURN(0); }