From 97057115962d9dfbe989c799cff089aec5cbcc60 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Mon, 9 Aug 2010 11:32:50 +0300 Subject: WL#1054: Pluggable authentication support Merged the implementation to a new base tree. --- tests/mysql_client_test.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 61f9d4881cb..edb98f8c1a7 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -33,6 +33,7 @@ #include #include #include +#include #define VER "2.1" #define MAX_TEST_QUERY_LENGTH 300 /* MAX QUERY BUFFER LENGTH */ -- cgit v1.2.1 From cd1c6e220de1730615c145b5337f7cce554dfdae Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Wed, 10 Nov 2010 19:14:47 -0200 Subject: Bug#58057: 5.1 libmysql/libmysql.c unused variable/compile failure Bug#57995: Compiler flag change build error on OSX 10.4: my_getncpus.c Bug#57996: Compiler flag change build error on OSX 10.5 : bind.c Bug#57994: Compiler flag change build error : my_redel.c Bug#57993: Compiler flag change build error on FreeBsd 7.0 : regexec.c Bug#57992: Compiler flag change build error on FreeBsd : mf_keycache.c Bug#57997: Compiler flag change build error on OSX 10.6: debug_sync.cc Fix assorted compiler generated warnings. cmd-line-utils/readline/bind.c: Bug#57996: Compiler flag change build error on OSX 10.5 : bind.c Initialize variable to work around a false positive warning. include/m_string.h: Bug#57994: Compiler flag change build error : my_redel.c The expansion of stpcpy (in glibc) causes warnings if the return value of strmov is not being used. Since stpcpy is a GNU extension and the expansion ends up using a built-in provided by GCC, use the compiler provided built-in directly when possible. include/my_compiler.h: Define a dummy MY_GNUC_PREREQ when not compiling with GCC. libmysql/libmysql.c: Bug#58057: 5.1 libmysql/libmysql.c unused variable/compile failure Variable might not be used in some cases. So, tag it as unused. mysys/mf_keycache.c: Bug#57992: Compiler flag change build error on FreeBsd : mf_keycache.c Use UNINIT_VAR to work around a false positive warning. mysys/my_getncpus.c: Bug#57995: Compiler flag change build error on OSX 10.4: my_getncpus.c Declare variable in the same block where it is used. regex/regexec.c: Bug#57993: Compiler flag change build error on FreeBsd 7.0 : regexec.c Work around a compiler bug which causes the cast to not be enforced. sql/debug_sync.cc: Bug#57997: Compiler flag change build error on OSX 10.6: debug_sync.cc Use UNINIT_VAR to work around a false positive warning. sql/handler.cc: Use UNINIT_VAR to work around a false positive warning. sql/slave.cc: Use UNINIT_VAR to work around a false positive warning. sql/sql_partition.cc: Use UNINIT_VAR to work around a false positive warning. storage/myisam/ft_nlq_search.c: Use UNINIT_VAR to work around a false positive warning. storage/myisam/mi_create.c: Use UNINIT_VAR to work around a false positive warning. storage/myisammrg/myrg_open.c: Use UNINIT_VAR to work around a false positive warning. tests/mysql_client_test.c: Change function to take a pointer to const, no need for a cast. --- tests/mysql_client_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 3bfcf3ee233..ed8031b3fc3 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -1175,7 +1175,7 @@ my_bool fetch_n(const char **query_list, unsigned query_count, /* Separate thread query to test some cases */ -static my_bool thread_query(char *query) +static my_bool thread_query(const char *query) { MYSQL *l_mysql; my_bool error; @@ -1197,7 +1197,7 @@ static my_bool thread_query(char *query) goto end; } l_mysql->reconnect= 1; - if (mysql_query(l_mysql, (char *)query)) + if (mysql_query(l_mysql, query)) { fprintf(stderr, "Query failed (%s)\n", mysql_error(l_mysql)); error= 1; @@ -5821,7 +5821,7 @@ static void test_prepare_alter() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - if (thread_query((char *)"ALTER TABLE test_prep_alter change id id_new varchar(20)")) + if (thread_query("ALTER TABLE test_prep_alter change id id_new varchar(20)")) exit(1); is_null= 1; -- cgit v1.2.1 From 78fa2e4d6d89b8d0bb4b26fe648668b97c9400b9 Mon Sep 17 00:00:00 2001 From: Konstantin Osipov Date: Fri, 12 Nov 2010 15:56:21 +0300 Subject: Implement a fix for Bug#57058 -- send SERVER_QUERY_WAS_SLOW over network when a query was slow. When a query is slow, sent a special flag to the client indicating this fact. Add a test case. Implement review comments. include/mysql_com.h: Clear SERVER_QUERY_WAS_SLOW at end of each statement. Since this patch removes the technique when thd->server_status is modified briefly only to execute my_eof(), reset more server status bit that may remain in the status from execution of the previous statement. sql/protocol.cc: Always use thd->server_status to in net_* functions to send the latest status to the client. sql/sp_head.cc: Calculate if a query was slow before sending EOF packet. sql/sql_cursor.cc: Remove juggling with thd->server_status. The extra status bits are reset at start of the next statement. sql/sql_db.cc: Remove juggling with thd->server_status. The extra status bits are reset at start of the next statement. sql/sql_error.cc: Remove m_server_status member, it's not really part of the Diagnostics_area. sql/sql_error.h: Remove server_status member, it's not part of the Diagnostics_area. The associated hack is removed as well. sql/sql_parse.cc: Do not calculate if a query was slow twice. Use a status flag in thd->server_status. tests/mysql_client_test.c: Add a test case for Bug#57058. Check that the status is present at the client, when sent. --- tests/mysql_client_test.c | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index b85a6c587e4..3d709720727 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -19061,7 +19061,7 @@ static void test_bug49972() my_bool is_null; DBUG_ENTER("test_bug49972"); - myheader("test_49972"); + myheader("test_bug49972"); rc= mysql_query(mysql, "DROP FUNCTION IF EXISTS f1"); myquery(rc); @@ -19148,6 +19148,45 @@ static void test_bug49972() DBUG_VOID_RETURN; } + +/** + Bug#57058 SERVER_QUERY_WAS_SLOW not wired up. +*/ + +static void test_bug57058() +{ + MYSQL_RES *res; + int rc; + + DBUG_ENTER("test_bug57058"); + myheader("test_bug57058"); + + rc= mysql_query(mysql, "set @@session.long_query_time=0.1"); + myquery(rc); + + DIE_UNLESS(!(mysql->server_status & SERVER_QUERY_WAS_SLOW)); + + rc= mysql_query(mysql, "select sleep(1)"); + myquery(rc); + + /* + Important: the flag is sent in the last EOF packet of + the query, the one which ends the result. Read the + result to see the "slow" status. + */ + res= mysql_store_result(mysql); + + DIE_UNLESS(mysql->server_status & SERVER_QUERY_WAS_SLOW); + + mysql_free_result(res); + + rc= mysql_query(mysql, "set @@session.long_query_time=default"); + myquery(rc); + + DBUG_VOID_RETURN; +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -19481,6 +19520,7 @@ static struct my_tests_st my_tests[]= { { "test_bug42373", test_bug42373 }, { "test_bug54041", test_bug54041 }, { "test_bug47485", test_bug47485 }, + { "test_bug57058", test_bug57058 }, { 0, 0 } }; -- cgit v1.2.1 From 3fa437cf4061c20f2995e859b89a6898d3b646b4 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Sat, 13 Nov 2010 18:05:02 +0300 Subject: Fix for Bug#56934 (mysql_stmt_fetch() incorrectly fills MYSQL_TIME structure buffer). This is a follow-up for WL#4435. The bug actually existed not only MYSQL_TYPE_DATETIME type. The problem was that Item_param::set_value() was written in an assumption that it's working with expressions, i.e. with basic data types. There are two different quick fixes here: a) Change Item_param::make_field() -- remove setting of Send_field::length, Send_field::charsetnr, Send_field::flags and Send_field::type. That would lead to marshalling all data using basic types to the client (MYSQL_TYPE_LONGLONG, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_STRING and MYSQL_TYPE_NEWDECIMAL). In particular, that means, DATETIME would be sent as MYSQL_TYPE_STRING, TINYINT -- as MYSQL_TYPE_LONGLONG, etc. That could be Ok for the client, because the client library does reverse conversion automatically (the client program would see DATETIME as MYSQL_TIME object). However, there is a problem with metadata -- the metadata would be wrong (misleading): it would say that DATETIME is marshaled as MYSQL_TYPE_DATETIME, not as MYSQL_TYPE_STRING. b) Set Item_param::param_type properly to actual underlying field type. That would lead to double conversion inside the server: for example, MYSQL_TIME-object would be converted into STRING-object (in Item_param::set_value()), and then converted back to MYSQL_TIME-object (in Item_param::send()). The data however would be marshalled more properly, and also metadata would be correct. This patch implements b). There is also a possibility to avoid double conversion either by clonning the data field, or by storing a reference to it and using it on Item::send() time. That requires more work and might be done later. --- tests/mysql_client_test.c | 250 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 250 insertions(+) (limited to 'tests') diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index b85a6c587e4..5ddf428602b 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -2103,6 +2103,255 @@ static void test_wl4435_2() } +#define WL4435_TEST(sql_type, sql_value, \ + c_api_in_type, c_api_out_type, \ + c_type, c_type_ext, \ + printf_args, assert_condition) \ +\ + do { \ + int rc; \ + MYSQL_STMT *ps; \ + MYSQL_BIND psp; \ + MYSQL_RES *rs_metadata; \ + MYSQL_FIELD *fields; \ + c_type pspv c_type_ext; \ + my_bool psp_null; \ + \ + bzero(&pspv, sizeof (pspv)); \ + \ + rc= mysql_query(mysql, "DROP PROCEDURE IF EXISTS p1"); \ + myquery(rc); \ + \ + rc= mysql_query(mysql, \ + "CREATE PROCEDURE p1(OUT v " sql_type ") SET v = " sql_value ";"); \ + myquery(rc); \ + \ + ps = mysql_simple_prepare(mysql, "CALL p1(?)"); \ + check_stmt(ps); \ + \ + bzero(&psp, sizeof (psp)); \ + psp.buffer_type= c_api_in_type; \ + psp.is_null= &psp_null; \ + psp.buffer= (char *) &pspv; \ + psp.buffer_length= sizeof (psp); \ + \ + rc= mysql_stmt_bind_param(ps, &psp); \ + check_execute(ps, rc); \ + \ + rc= mysql_stmt_execute(ps); \ + check_execute(ps, rc); \ + \ + DIE_UNLESS(mysql->server_status & SERVER_PS_OUT_PARAMS); \ + DIE_UNLESS(mysql_stmt_field_count(ps) == 1); \ + \ + rs_metadata= mysql_stmt_result_metadata(ps); \ + fields= mysql_fetch_fields(rs_metadata); \ + \ + rc= mysql_stmt_bind_result(ps, &psp); \ + check_execute(ps, rc); \ + \ + rc= mysql_stmt_fetch(ps); \ + DIE_UNLESS(rc == 0); \ + \ + DIE_UNLESS(fields[0].type == c_api_out_type); \ + printf printf_args; \ + printf("; in type: %d; out type: %d\n", \ + (int) c_api_in_type, (int) c_api_out_type); \ + \ + rc= mysql_stmt_fetch(ps); \ + DIE_UNLESS(rc == MYSQL_NO_DATA); \ + \ + rc= mysql_stmt_next_result(ps); \ + DIE_UNLESS(rc == 0); \ + \ + mysql_stmt_free_result(ps); \ + mysql_stmt_close(ps); \ + \ + DIE_UNLESS(assert_condition); \ + \ + } while (0) + +static void test_wl4435_3() +{ + char tmp[255]; + + puts(""); + + // The following types are not supported: + // - ENUM + // - SET + // + // The following types are supported but can not be used for + // OUT-parameters: + // - MEDIUMINT; + // - BIT(..); + // + // The problem is that those types are not supported for IN-parameters, + // and OUT-parameters should be bound as IN-parameters before execution. + // + // The following types should not be used: + // - MYSQL_TYPE_YEAR (use MYSQL_TYPE_SHORT instead); + // - MYSQL_TYPE_TINY_BLOB, MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_LONG_BLOB + // (use MYSQL_TYPE_BLOB instead); + + WL4435_TEST("TINYINT", "127", + MYSQL_TYPE_TINY, MYSQL_TYPE_TINY, + char, , + (" - TINYINT / char / MYSQL_TYPE_TINY:\t\t\t %d", (int) pspv), + pspv == 127); + + WL4435_TEST("SMALLINT", "32767", + MYSQL_TYPE_SHORT, MYSQL_TYPE_SHORT, + short, , + (" - SMALLINT / short / MYSQL_TYPE_SHORT:\t\t %d", (int) pspv), + pspv == 32767); + + WL4435_TEST("INT", "2147483647", + MYSQL_TYPE_LONG, MYSQL_TYPE_LONG, + int, , + (" - INT / int / MYSQL_TYPE_LONG:\t\t\t %d", pspv), + pspv == 2147483647l); + + WL4435_TEST("BIGINT", "9223372036854775807", + MYSQL_TYPE_LONGLONG, MYSQL_TYPE_LONGLONG, + long long, , + (" - BIGINT / long long / MYSQL_TYPE_LONGLONG:\t\t %lld", pspv), + pspv == 9223372036854775807ll); + + WL4435_TEST("TIMESTAMP", "'2007-11-18 15:01:02'", + MYSQL_TYPE_TIMESTAMP, MYSQL_TYPE_TIMESTAMP, + MYSQL_TIME, , + (" - TIMESTAMP / MYSQL_TIME / MYSQL_TYPE_TIMESTAMP:\t " + "%.4d-%.2d-%.2d %.2d:%.2d:%.2d", + (int) pspv.year, (int) pspv.month, (int) pspv.day, + (int) pspv.hour, (int) pspv.minute, (int) pspv.second), + pspv.year == 2007 && pspv.month == 11 && pspv.day == 18 && + pspv.hour == 15 && pspv.minute == 1 && pspv.second == 2); + + WL4435_TEST("DATETIME", "'1234-11-12 12:34:59'", + MYSQL_TYPE_DATETIME, MYSQL_TYPE_DATETIME, + MYSQL_TIME, , + (" - DATETIME / MYSQL_TIME / MYSQL_TYPE_DATETIME:\t " + "%.4d-%.2d-%.2d %.2d:%.2d:%.2d", + (int) pspv.year, (int) pspv.month, (int) pspv.day, + (int) pspv.hour, (int) pspv.minute, (int) pspv.second), + pspv.year == 1234 && pspv.month == 11 && pspv.day == 12 && + pspv.hour == 12 && pspv.minute == 34 && pspv.second == 59); + + WL4435_TEST("TIME", "'123:45:01'", + MYSQL_TYPE_TIME, MYSQL_TYPE_TIME, + MYSQL_TIME, , + (" - TIME / MYSQL_TIME / MYSQL_TYPE_TIME:\t\t " + "%.3d:%.2d:%.2d", + (int) pspv.hour, (int) pspv.minute, (int) pspv.second), + pspv.hour == 123 && pspv.minute == 45 && pspv.second == 1); + + WL4435_TEST("DATE", "'1234-11-12'", + MYSQL_TYPE_DATE, MYSQL_TYPE_DATE, + MYSQL_TIME, , + (" - DATE / MYSQL_TIME / MYSQL_TYPE_DATE:\t\t " + "%.4d-%.2d-%.2d", + (int) pspv.year, (int) pspv.month, (int) pspv.day), + pspv.year == 1234 && pspv.month == 11 && pspv.day == 12); + + WL4435_TEST("YEAR", "'2010'", + MYSQL_TYPE_SHORT, MYSQL_TYPE_YEAR, + short, , + (" - YEAR / short / MYSQL_TYPE_SHORT:\t\t\t %.4d", (int) pspv), + pspv == 2010); + + WL4435_TEST("FLOAT(7, 4)", "123.4567", + MYSQL_TYPE_FLOAT, MYSQL_TYPE_FLOAT, + float, , + (" - FLOAT / float / MYSQL_TYPE_FLOAT:\t\t\t %g", (double) pspv), + pspv - 123.4567 < 0.0001); + + WL4435_TEST("DOUBLE(8, 5)", "123.45678", + MYSQL_TYPE_DOUBLE, MYSQL_TYPE_DOUBLE, + double, , + (" - DOUBLE / double / MYSQL_TYPE_DOUBLE:\t\t %g", (double) pspv), + pspv - 123.45678 < 0.00001); + + WL4435_TEST("DECIMAL(9, 6)", "123.456789", + MYSQL_TYPE_NEWDECIMAL, MYSQL_TYPE_NEWDECIMAL, + char, [255], + (" - DECIMAL / char[] / MYSQL_TYPE_NEWDECIMAL:\t\t '%s'", (char *) pspv), + !strcmp(pspv, "123.456789")); + + WL4435_TEST("CHAR(32)", "REPEAT('C', 16)", + MYSQL_TYPE_STRING, MYSQL_TYPE_STRING, + char, [255], + (" - CHAR(32) / char[] / MYSQL_TYPE_STRING:\t\t '%s'", (char *) pspv), + !strcmp(pspv, "CCCCCCCCCCCCCCCC")); + + WL4435_TEST("VARCHAR(32)", "REPEAT('V', 16)", + MYSQL_TYPE_VAR_STRING, MYSQL_TYPE_VAR_STRING, + char, [255], + (" - VARCHAR(32) / char[] / MYSQL_TYPE_VAR_STRING:\t '%s'", (char *) pspv), + !strcmp(pspv, "VVVVVVVVVVVVVVVV")); + + WL4435_TEST("TINYTEXT", "REPEAT('t', 16)", + MYSQL_TYPE_TINY_BLOB, MYSQL_TYPE_BLOB, + char, [255], + (" - TINYTEXT / char[] / MYSQL_TYPE_TINY_BLOB:\t\t '%s'", (char *) pspv), + !strcmp(pspv, "tttttttttttttttt")); + + WL4435_TEST("TEXT", "REPEAT('t', 16)", + MYSQL_TYPE_BLOB, MYSQL_TYPE_BLOB, + char, [255], + (" - TEXT / char[] / MYSQL_TYPE_BLOB:\t\t\t '%s'", (char *) pspv), + !strcmp(pspv, "tttttttttttttttt")); + + WL4435_TEST("MEDIUMTEXT", "REPEAT('t', 16)", + MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_BLOB, + char, [255], + (" - MEDIUMTEXT / char[] / MYSQL_TYPE_MEDIUM_BLOB:\t '%s'", (char *) pspv), + !strcmp(pspv, "tttttttttttttttt")); + + WL4435_TEST("LONGTEXT", "REPEAT('t', 16)", + MYSQL_TYPE_LONG_BLOB, MYSQL_TYPE_BLOB, + char, [255], + (" - LONGTEXT / char[] / MYSQL_TYPE_LONG_BLOB:\t\t '%s'", (char *) pspv), + !strcmp(pspv, "tttttttttttttttt")); + + WL4435_TEST("BINARY(32)", "REPEAT('\1', 16)", + MYSQL_TYPE_STRING, MYSQL_TYPE_STRING, + char, [255], + (" - BINARY(32) / char[] / MYSQL_TYPE_STRING:\t\t '%s'", (char *) pspv), + memset(tmp, 1, 16) && !memcmp(tmp, pspv, 16)); + + WL4435_TEST("VARBINARY(32)", "REPEAT('\1', 16)", + MYSQL_TYPE_VAR_STRING, MYSQL_TYPE_VAR_STRING, + char, [255], + (" - VARBINARY(32) / char[] / MYSQL_TYPE_VAR_STRING:\t '%s'", (char *) pspv), + memset(tmp, 1, 16) && !memcmp(tmp, pspv, 16)); + + WL4435_TEST("TINYBLOB", "REPEAT('\2', 16)", + MYSQL_TYPE_TINY_BLOB, MYSQL_TYPE_BLOB, + char, [255], + (" - TINYBLOB / char[] / MYSQL_TYPE_TINY_BLOB:\t\t '%s'", (char *) pspv), + memset(tmp, 2, 16) && !memcmp(tmp, pspv, 16)); + + WL4435_TEST("BLOB", "REPEAT('\2', 16)", + MYSQL_TYPE_BLOB, MYSQL_TYPE_BLOB, + char, [255], + (" - BLOB / char[] / MYSQL_TYPE_BLOB:\t\t\t '%s'", (char *) pspv), + memset(tmp, 2, 16) && !memcmp(tmp, pspv, 16)); + + WL4435_TEST("MEDIUMBLOB", "REPEAT('\2', 16)", + MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_BLOB, + char, [255], + (" - MEDIUMBLOB / char[] / MYSQL_TYPE_MEDIUM_BLOB:\t '%s'", (char *) pspv), + memset(tmp, 2, 16) && !memcmp(tmp, pspv, 16)); + + WL4435_TEST("LONGBLOB", "REPEAT('\2', 16)", + MYSQL_TYPE_LONG_BLOB, MYSQL_TYPE_BLOB, + char, [255], + (" - LONGBLOB / char[] / MYSQL_TYPE_LONG_BLOB:\t\t '%s'", (char *) pspv), + memset(tmp, 2, 16) && !memcmp(tmp, pspv, 16)); +} + + /* Test simple prepare field results */ static void test_prepare_field_result() @@ -19468,6 +19717,7 @@ static struct my_tests_st my_tests[]= { { "test_wl4284_1", test_wl4284_1 }, { "test_wl4435", test_wl4435 }, { "test_wl4435_2", test_wl4435_2 }, + { "test_wl4435_3", test_wl4435_3 }, { "test_bug38486", test_bug38486 }, { "test_bug33831", test_bug33831 }, { "test_bug40365", test_bug40365 }, -- cgit v1.2.1 From 8664de2230300967537d75a9ec51d15c400ca36d Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sat, 20 Nov 2010 12:47:50 -0200 Subject: WL#5665: Removal of the autotools-based build system The autotools-based build system has been superseded and is being removed in order to ease the maintenance burden on developers tweaking and maintaining the build system. In order to support tools that need to extract the server version, a new file that (only) contains the server version, called VERSION, is introduced. The file contents are human and machine-readable. The format is: MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 MYSQL_VERSION_PATCH=8 MYSQL_VERSION_EXTRA=-rc The CMake based version extraction in cmake/mysql_version.cmake is changed to extract the version from this file. The configure to CMake wrapper is retained for backwards compatibility and to support the BUILD/ scripts. Also, a new a makefile target show-dist-name that prints the server version is introduced. VERSION: Add top-level version file. cmake/mysql_version.cmake: Get version information from the top-level VERSION file. Do not cache the version components (MAJOR_VERSION, etc). Add MYSQL_RPM_VERSION as a replacement for MYSQL_U_SCORE_VERSION. --- tests/Makefile.am | 62 ------------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 tests/Makefile.am (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am deleted file mode 100644 index ca4a2a4e986..00000000000 --- a/tests/Makefile.am +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (C) 2000-2006 MySQL AB -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; version 2 -# of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public -# License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, USA - -## Process this file with automake to create Makefile.in - - -if THREAD_SAFE_CLIENT -LIBMYSQLCLIENT_LA = $(top_builddir)/libmysql_r/libmysqlclient_r.la -else -LIBMYSQLCLIENT_LA = $(top_builddir)/libmysql/libmysqlclient.la -endif - -EXTRA_DIST = auto_increment.res auto_increment.tst \ - function.res function.tst lock_test.pl lock_test.res \ - export.pl big_record.pl \ - fork2_test.pl fork_big.pl \ - insert_and_repair.pl \ - grant.pl grant.res test_delayed_insert.pl \ - pmail.pl mail_to_db.pl table_types.pl \ - myisam-big-rows.tst \ - CMakeLists.txt - -bin_PROGRAMS = mysql_client_test -noinst_PROGRAMS = insert_test select_test thread_test bug25714 - -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \ - $(openssl_includes) -LIBS = @CLIENT_LIBS@ -LDADD = @CLIENT_EXTRA_LDFLAGS@ \ - $(LIBMYSQLCLIENT_LA) - -mysql_client_test_LDADD= $(LDADD) $(CXXLDFLAGS) -mysql_client_test_SOURCES= mysql_client_test.c\ - $(top_srcdir)/mysys/my_memmem.c - -insert_test_SOURCES= insert_test.c -select_test_SOURCES= select_test.c -insert_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) -select_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) - -bug25714_SOURCES= bug25714.c -bug25714_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) - -# Fix for mit-threads -DEFS = -DMYSQL_CLIENT_NO_THREADS - -thread_test.o: thread_test.c - $(COMPILE) -c $(INCLUDES) $< -- cgit v1.2.1 From 7336ac45b77bb8f794de3c37d6aa4864c02c6c57 Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Thu, 25 Nov 2010 03:11:05 +0000 Subject: Assorted post-merge fixes, clean-up, integration, compat with 5.6. 43233/55794. mysql-test/r/change_user.result: Don't use -1 integer wrap around. It used to work, but now we do what's actually in the documentation. In tests, we now use DEFAULT or the numeral equivalent (as we do in the 5.6 tests). mysql-test/r/key_cache.result: Can't drop default key case is an error now, not a warning, for compatibility with 5.6. mysql-test/r/variables.result: Can't drop default key case is an error now, not a warning, for compatibility with 5.6. mysql-test/t/change_user.test: Don't use -1 integer wrap around. It used to work, but now we do what's actually in the documentation. In tests, we now use DEFAULT or the numeral equivalent (as we do in the 5.6 tests). mysql-test/t/key_cache.test: Can't drop default key case is an error now, not a warning, for compatibility with 5.6. mysql-test/t/variables.test: Can't drop default key case is an error now, not a warning, for compatibility with 5.6. sql/mysqld.cc: 0 is a legal (albeit magic) value: "drop key cache." sql/set_var.cc: bound_unsigned() can go now, it was just a kludge until things are done The Right Way, which they are now. Can't drop default key case is an error now, not a warning, for compatibility with 5.6. tests/mysql_client_test.c: Don't use -1 integer wrap around. It used to work, but now we do what's actually in the documentation. In tests, we now use DEFAULT or the numeral equivalent (as we do in the 5.6 tests). --- tests/mysql_client_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index ed8031b3fc3..53e2ed1d082 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -17125,7 +17125,7 @@ static void test_bug20023() /* Set MAX_JOIN_SIZE to the default value (-1). */ - DIE_IF(mysql_query(&con, "SET @@global.max_join_size = -1")); + DIE_IF(mysql_query(&con, "SET @@global.max_join_size = 18446744073709551615")); DIE_IF(mysql_query(&con, "SET @@session.max_join_size = default")); /* Issue COM_CHANGE_USER. */ @@ -17156,7 +17156,7 @@ static void test_bug20023() DIE_IF(mysql_query(&con, query_buffer)); - DIE_IF(mysql_query(&con, "SET @@global.max_join_size = -1")); + DIE_IF(mysql_query(&con, "SET @@global.max_join_size = 18446744073709551615")); DIE_IF(mysql_query(&con, "SET @@session.max_join_size = default")); /* Issue COM_CHANGE_USER. */ -- cgit v1.2.1 From 85323eda8a5823e4db1fa34dc998684b67e710b5 Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Tue, 28 Dec 2010 19:57:23 +0100 Subject: - Added/updated copyright headers - Removed files specific to compiling on OS/2 - Removed files specific to SCO Unix packaging - Removed "libmysqld/copyright", text is included in documentation - Removed LaTeX headers for NDB Doxygen documentation - Removed obsolete NDB files - Removed "mkisofs" binaries - Removed the "cvs2cl.pl" script - Changed a few GPL texts to use "program" instead of "library" --- tests/Makefile.am | 4 ++-- tests/big_record.pl | 15 +++++++++++++++ tests/drop_test.pl | 16 ++++++++++++++++ tests/export.pl | 15 +++++++++++++++ tests/fork2_test.pl | 15 +++++++++++++++ tests/fork_big.pl | 16 ++++++++++++++++ tests/fork_big2.pl | 16 ++++++++++++++++ tests/grant.pl | 16 ++++++++++++++++ tests/index_corrupt.pl | 16 ++++++++++++++++ tests/insert_and_repair.pl | 16 ++++++++++++++++ tests/lock_test.pl | 15 +++++++++++++++ tests/mysql_client_test.c | 2 +- tests/pmail.pl | 16 ++++++++++++++++ tests/rename_test.pl | 16 ++++++++++++++++ tests/table_types.pl | 16 +++++++++++++++- tests/test_delayed_insert.pl | 15 +++++++++++++++ tests/truncate.pl | 16 ++++++++++++++++ 17 files changed, 237 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 1c39a3630dd..8d5e7fb213b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,11 +1,11 @@ # Copyright (C) 2000-2006 MySQL AB # -# This library is free software; you can redistribute it and/or +# This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; version 2 # of the License. # -# This library is distributed in the hope that it will be useful, +# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. diff --git a/tests/big_record.pl b/tests/big_record.pl index fbe94e3540f..77d1e613193 100755 --- a/tests/big_record.pl +++ b/tests/big_record.pl @@ -1,5 +1,20 @@ #!/usr/bin/perl +# Copyright (C) 2000, 2003 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # This is a test with stores big records in a blob. # Note that for the default test the mysql server should have been # started with at least 'mysqld -O max_allowed_packet=30M' and you should have diff --git a/tests/drop_test.pl b/tests/drop_test.pl index 9dcadf45c2e..272c4029e0f 100755 --- a/tests/drop_test.pl +++ b/tests/drop_test.pl @@ -1,4 +1,20 @@ #!/usr/bin/perl -w + +# Copyright (C) 2000 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # # This is a test with uses processes to insert, select and drop tables. # diff --git a/tests/export.pl b/tests/export.pl index 29f0d1af8ff..d543ede8697 100755 --- a/tests/export.pl +++ b/tests/export.pl @@ -1,5 +1,20 @@ #!/usr/bin/perl +# Copyright (C) 2000, 2001 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # This is a test with uses two processes to a database. # The other inserts records in two tables, the other does a lot of joins # on these. diff --git a/tests/fork2_test.pl b/tests/fork2_test.pl index 19fab5a67d6..64e3e060b09 100755 --- a/tests/fork2_test.pl +++ b/tests/fork2_test.pl @@ -1,5 +1,20 @@ #!/usr/bin/perl -w +# Copyright (C) 2000, 2001 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # This is a test with uses 5 processes to insert, update and select from # two tables. # One inserts records in the tables, one updates some record in it and diff --git a/tests/fork_big.pl b/tests/fork_big.pl index c72eb59946b..9b45cb43f8e 100755 --- a/tests/fork_big.pl +++ b/tests/fork_big.pl @@ -1,4 +1,20 @@ #!/usr/bin/perl -w + +# Copyright (C) 2001 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # # This is a test with uses many processes to test a MySQL server. # diff --git a/tests/fork_big2.pl b/tests/fork_big2.pl index 567cfafa176..b866998b3b4 100644 --- a/tests/fork_big2.pl +++ b/tests/fork_big2.pl @@ -1,4 +1,20 @@ #!/usr/bin/perl -w + +# Copyright (C) 2002, 2005 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # # This is a test with uses many processes to test a MySQL server. # diff --git a/tests/grant.pl b/tests/grant.pl index 4f2bd1a61cb..368ce0b3254 100755 --- a/tests/grant.pl +++ b/tests/grant.pl @@ -1,4 +1,20 @@ #!/usr/bin/perl + +# Copyright (C) 2000, 2005 MySQL AB, 2009 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # # Testing of grants. # Note that this will delete all table and column grants ! diff --git a/tests/index_corrupt.pl b/tests/index_corrupt.pl index 19bf54f5d11..fa4c8151277 100755 --- a/tests/index_corrupt.pl +++ b/tests/index_corrupt.pl @@ -1,4 +1,20 @@ #!/usr/bin/perl -w + +# Copyright (C) 2005 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # # This is a test for a key cache bug (bug #10167) # To expose the bug mysqld should be started with --key-buffer-size=64K diff --git a/tests/insert_and_repair.pl b/tests/insert_and_repair.pl index 1c7186bb651..00ab20f051b 100755 --- a/tests/insert_and_repair.pl +++ b/tests/insert_and_repair.pl @@ -1,4 +1,20 @@ #!/usr/bin/perl -w + +# Copyright (C) 2000, 2001 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # # This is a test of insert and repair/check. # diff --git a/tests/lock_test.pl b/tests/lock_test.pl index 5daeeddad8e..a40bec681f6 100755 --- a/tests/lock_test.pl +++ b/tests/lock_test.pl @@ -1,5 +1,20 @@ #!/usr/bin/perl +# Copyright (C) 2000 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # This is a test with uses two processes to a database. # The other inserts records in two tables, the other does a lot of joins # on these. diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 43a418c8300..82199781d74 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2004 MySQL AB +/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/tests/pmail.pl b/tests/pmail.pl index 02d5d60ac0f..38905832069 100755 --- a/tests/pmail.pl +++ b/tests/pmail.pl @@ -1,4 +1,20 @@ #!/usr/bin/perl -w + +# Copyright (C) 2000, 2005 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # # Prints mails to standard output # diff --git a/tests/rename_test.pl b/tests/rename_test.pl index edf3216a62f..23fc33c9095 100755 --- a/tests/rename_test.pl +++ b/tests/rename_test.pl @@ -1,4 +1,20 @@ #!/usr/bin/perl -w + +# Copyright (C) 2000, 2001 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # # This is a test with uses processes to insert, select and drop tables. # diff --git a/tests/table_types.pl b/tests/table_types.pl index 4dbcdcb975c..23d26215abe 100755 --- a/tests/table_types.pl +++ b/tests/table_types.pl @@ -1,5 +1,19 @@ #!/usr/bin/perl -# + +# Copyright (C) 2000, 2003 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA use DBI; use Benchmark; diff --git a/tests/test_delayed_insert.pl b/tests/test_delayed_insert.pl index c7a8f0ca4b7..5046c4fb580 100755 --- a/tests/test_delayed_insert.pl +++ b/tests/test_delayed_insert.pl @@ -1,5 +1,20 @@ #!/usr/bin/perl -w +# Copyright (C) 2000, 2001 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # This is a test for INSERT DELAYED # diff --git a/tests/truncate.pl b/tests/truncate.pl index 57b50cf96b6..85e826fd4cd 100755 --- a/tests/truncate.pl +++ b/tests/truncate.pl @@ -1,4 +1,20 @@ #!/usr/bin/perl -w + +# Copyright (C) 2002 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # # This is a test with uses many processes to test a MySQL server. # -- cgit v1.2.1 From 8ede0759c30bb49025b466a69951d5f36d2b6b92 Mon Sep 17 00:00:00 2001 From: Magne Mahre Date: Tue, 11 Jan 2011 10:07:37 +0100 Subject: Remove configuration preprocessor symbols 'THREAD' and 'THREAD_SAFE_CLIENT'. As of MySQL 5.5, we no longer support non-threaded builds. This patch removes all references to the obsolete THREAD and THREAD_SAFE_CLIENT preprocessor symbols. These were used to distinguish between threaded and non-threaded builds. --- tests/thread_test.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'tests') diff --git a/tests/thread_test.c b/tests/thread_test.c index c243a3a7321..4edfe59772c 100644 --- a/tests/thread_test.c +++ b/tests/thread_test.c @@ -15,15 +15,6 @@ #include -#ifndef THREAD - -int main(int argc __attribute__((unused)), char **argv __attribute__((unused))) -{ - printf("This test must be compiled with multithread support to work\n"); - exit(1); -} -#else - #include #include #include "mysql.h" @@ -254,4 +245,3 @@ int main(int argc, char **argv) return 0; /* Keep some compilers happy */ } -#endif /* THREAD */ -- cgit v1.2.1 From f4beb9294046ac368cfb66fc3270298a85dbdf4a Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 18 Feb 2011 12:46:55 +0300 Subject: Bug#11765108 (Bug#58036) client utf32, utf16, ucs2 should be disallowed, they crash server Problem: ucs2 was correctly disallowed in "SET NAMES" only, while mysql_real_connect() and mysql_change_user() still allowed to use ucs2, which made server crash. Fix: disallow ucs2 in mysql_real_connect() and mysql_change_user(). @ sql/set_var.cc Using new function. @ sql/sql_acl.cc - Return error if character set initialization failed - Getting rid of pointer aliasing: Initialize user_name to NULL, to avoid double free(). @ sql/sql_connect.cc - in case of unsupported client character set send error and return true - in case of success return false @ sql/sql_connect.h - changing return type for thd_init_client_charset() to bool, to return errors to the caller @ sql/sql_parse.h - introducing a new function, to reuse in all places where we need to check client character set. @ tests/mysql_client_test.c Adding test --- tests/mysql_client_test.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'tests') diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 3861a3e1cf8..fa9e7c670ec 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -19288,6 +19288,72 @@ static void test_bug47485() } +/* + Bug#58036 client utf32, utf16, ucs2 should be disallowed, they crash server +*/ +static void test_bug58036() +{ + MYSQL *conn; + DBUG_ENTER("test_bug47485"); + myheader("test_bug58036"); + + /* Part1: try to connect with ucs2 client character set */ + conn= mysql_client_init(NULL); + mysql_options(conn, MYSQL_SET_CHARSET_NAME, "ucs2"); + if (mysql_real_connect(conn, opt_host, opt_user, + opt_password, opt_db ? opt_db : "test", + opt_port, opt_unix_socket, 0)) + { + if (!opt_silent) + printf("mysql_real_connect() succeeded (failure expected)\n"); + mysql_close(conn); + DIE(); + } + + if (!opt_silent) + printf("Got mysql_real_connect() error (expected): %s (%d)\n", + mysql_error(conn), mysql_errno(conn)); + DIE_UNLESS(mysql_errno(conn) == ER_WRONG_VALUE_FOR_VAR); + mysql_close(conn); + + + /* + Part2: + - connect with latin1 + - then change client character set to ucs2 + - then try mysql_change_user() + */ + conn= mysql_client_init(NULL); + mysql_options(conn, MYSQL_SET_CHARSET_NAME, "latin1"); + if (!mysql_real_connect(conn, opt_host, opt_user, + opt_password, opt_db ? opt_db : "test", + opt_port, opt_unix_socket, 0)) + { + if (!opt_silent) + printf("mysql_real_connect() failed: %s (%d)\n", + mysql_error(conn), mysql_errno(conn)); + mysql_close(conn); + DIE(); + } + + mysql_options(conn, MYSQL_SET_CHARSET_NAME, "ucs2"); + if (!mysql_change_user(conn, opt_user, opt_password, NULL)) + { + if (!opt_silent) + printf("mysql_change_user() succedded, error expected!"); + mysql_close(conn); + DIE(); + } + + if (!opt_silent) + printf("Got mysql_change_user() error (expected): %s (%d)\n", + mysql_error(conn), mysql_errno(conn)); + mysql_close(conn); + + DBUG_VOID_RETURN; +} + + /* Bug#49972: Crash in prepared statements. @@ -19770,6 +19836,7 @@ static struct my_tests_st my_tests[]= { { "test_bug42373", test_bug42373 }, { "test_bug54041", test_bug54041 }, { "test_bug47485", test_bug47485 }, + { "test_bug58036", test_bug58036 }, { "test_bug57058", test_bug57058 }, { 0, 0 } }; -- cgit v1.2.1 From 5f55c23208c746bd1211c09237fe85303dd49567 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 18 Feb 2011 16:12:36 +0300 Subject: Bug#11765108 (Bug#58036) client utf32, utf16, ucs2 should be disallowed, they crash server A separate fix for 5.1 (as 5.1 and 5.5 have seriously differged in the related pieces of the code). A patch for 5.5 was approved earlier. Problem: ucs2 was correctly disallowed in "SET NAMES" only, while mysql_real_connect() and mysql_change_user() still allowed to use ucs2, which made server crash. Fix: disallow ucs2 in mysql_real_connect() and mysql_change_user(). @ sql/sql_priv.h - changing return type for thd_init_client_charset() to bool, to return errors to the caller @ sql/sql_var.cc - using new function @ sql/sql_connect.cc - thd_client_charset_init: in case of unsupported client character set send error and return true; in case of success return false - check_connection: Return error if character set initialization failed @ sql/sql_parse.cc - check charset in the very beginnig of the CMD_CHANGE_USER handling code @ tests/mysql_client_test.c - adding tests --- tests/mysql_client_test.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'tests') diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 80c7be64e94..5a45c132a5f 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -18398,6 +18398,72 @@ static void test_bug47485() } +/* + Bug#58036 client utf32, utf16, ucs2 should be disallowed, they crash server +*/ +static void test_bug58036() +{ + MYSQL *conn; + DBUG_ENTER("test_bug47485"); + myheader("test_bug58036"); + + /* Part1: try to connect with ucs2 client character set */ + conn= mysql_client_init(NULL); + mysql_options(conn, MYSQL_SET_CHARSET_NAME, "ucs2"); + if (mysql_real_connect(conn, opt_host, opt_user, + opt_password, opt_db ? opt_db : "test", + opt_port, opt_unix_socket, 0)) + { + if (!opt_silent) + printf("mysql_real_connect() succeeded (failure expected)\n"); + mysql_close(conn); + DIE(); + } + + if (!opt_silent) + printf("Got mysql_real_connect() error (expected): %s (%d)\n", + mysql_error(conn), mysql_errno(conn)); + DIE_UNLESS(mysql_errno(conn) == ER_WRONG_VALUE_FOR_VAR); + mysql_close(conn); + + + /* + Part2: + - connect with latin1 + - then change client character set to ucs2 + - then try mysql_change_user() + */ + conn= mysql_client_init(NULL); + mysql_options(conn, MYSQL_SET_CHARSET_NAME, "latin1"); + if (!mysql_real_connect(conn, opt_host, opt_user, + opt_password, opt_db ? opt_db : "test", + opt_port, opt_unix_socket, 0)) + { + if (!opt_silent) + printf("mysql_real_connect() failed: %s (%d)\n", + mysql_error(conn), mysql_errno(conn)); + mysql_close(conn); + DIE(); + } + + mysql_options(conn, MYSQL_SET_CHARSET_NAME, "ucs2"); + if (!mysql_change_user(conn, opt_user, opt_password, NULL)) + { + if (!opt_silent) + printf("mysql_change_user() succedded, error expected!"); + mysql_close(conn); + DIE(); + } + + if (!opt_silent) + printf("Got mysql_change_user() error (expected): %s (%d)\n", + mysql_error(conn), mysql_errno(conn)); + mysql_close(conn); + + DBUG_VOID_RETURN; +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -18724,6 +18790,7 @@ static struct my_tests_st my_tests[]= { { "test_bug42373", test_bug42373 }, { "test_bug54041", test_bug54041 }, { "test_bug47485", test_bug47485 }, + { "test_bug58036", test_bug58036 }, { 0, 0 } }; -- cgit v1.2.1 From e2e6eb8f6d3dabbf335870efa29fcb77248ab156 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 18 Feb 2011 17:17:37 +0300 Subject: A post-fix for b58036. --- tests/mysql_client_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 5a45c132a5f..fc1f2e8293e 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -18417,7 +18417,7 @@ static void test_bug58036() if (!opt_silent) printf("mysql_real_connect() succeeded (failure expected)\n"); mysql_close(conn); - DIE(); + DIE(""); } if (!opt_silent) @@ -18443,7 +18443,7 @@ static void test_bug58036() printf("mysql_real_connect() failed: %s (%d)\n", mysql_error(conn), mysql_errno(conn)); mysql_close(conn); - DIE(); + DIE(""); } mysql_options(conn, MYSQL_SET_CHARSET_NAME, "ucs2"); @@ -18452,7 +18452,7 @@ static void test_bug58036() if (!opt_silent) printf("mysql_change_user() succedded, error expected!"); mysql_close(conn); - DIE(); + DIE(""); } if (!opt_silent) -- cgit v1.2.1 From 9320dca994fdae18c549cb59266d49846dc1f839 Mon Sep 17 00:00:00 2001 From: Dmitry Shulga Date: Tue, 15 Mar 2011 17:36:12 +0600 Subject: Fixed Bug#11764168 "56976: SEVERE DENIAL OF SERVICE IN PREPARED STATEMENTS". The problem was that server didn't check resulting size of prepared statement argument which was set using mysql_send_long_data() API. By calling mysql_send_long_data() several times it was possible to create overly big string and thus force server to allocate memory for it. There was no way to limit this allocation. The solution is to add check for size of result string against value of max_long_data_size start-up parameter. When intermediate string exceeds max_long_data_size value an appropriate error message is emitted. We can't use existing max_allowed_packet parameter for this purpose since its value is limited by 1GB and therefore using it as a limit for data set through mysql_send_long_data() API would have been an incompatible change. Newly introduced max_long_data_size parameter gets value from max_allowed_packet parameter unless its value is specified explicitly. This new parameter is marked as deprecated and will be eventually replaced by max_allowed_packet parameter. Value of max_long_data_size parameter can be set only at server startup. mysql-test/t/variables.test: Added checking for new start-up parameter max_long_data_size. sql/item.cc: Added call to my_message() when accumulated string exceeds max_long_data_size value. my_message() calls error handler that was installed in mysql_stmt_get_longdata before call to Item_param::set_longdata. The error handler then sets state, last_error and last_errno fields for current statement to values which correspond to error which was caught. sql/mysql_priv.h: Added max_long_data_size variable declaration. sql/mysqld.cc: Added support for start-up parameter 'max_long_data_size'. This parameter limits size of data which can be sent from client to server using mysql_send_long_data() API. sql/set_var.cc: Added variable 'max_long_data_size' into list of variables displayed by command 'show variables'. sql/sql_prepare.cc: Added error handler class Set_longdata_error_handler. This handler is used to catch any errors that can be generated during execution of Item_param::set_longdata(). Source code snippet that makes checking for statement's state during statement execution is moved from Prepared_statement::execute() to Prepared_statement::execute_loop() in order not to call set_parameters() when statement has failed during set_long_data() execution. If this hadn't been done the call to set_parameters() would have failed. tests/mysql_client_test.c: A testcase for the bug #56976 was added. --- tests/mysql_client_test.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'tests') diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index fc1f2e8293e..2e78c846fbc 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -18464,6 +18464,56 @@ static void test_bug58036() } +/* + Bug #56976: Severe Denial Of Service in prepared statements +*/ +static void test_bug56976() +{ + MYSQL_STMT *stmt; + MYSQL_BIND bind[1]; + int rc; + const char* query = "SELECT LENGTH(?)"; + char *long_buffer; + unsigned long i, packet_len = 256 * 1024L; + unsigned long dos_len = 2 * 1024 * 1024L; + + DBUG_ENTER("test_bug56976"); + myheader("test_bug56976"); + + stmt= mysql_stmt_init(mysql); + check_stmt(stmt); + + rc= mysql_stmt_prepare(stmt, query, strlen(query)); + check_execute(stmt, rc); + + memset(bind, 0, sizeof(bind)); + bind[0].buffer_type = MYSQL_TYPE_TINY_BLOB; + + rc= mysql_stmt_bind_param(stmt, bind); + check_execute(stmt, rc); + + long_buffer= (char*) my_malloc(packet_len, MYF(0)); + DIE_UNLESS(long_buffer); + + memset(long_buffer, 'a', packet_len); + + for (i= 0; i < dos_len / packet_len; i++) + { + rc= mysql_stmt_send_long_data(stmt, 0, long_buffer, packet_len); + check_execute(stmt, rc); + } + + my_free(long_buffer, MYF(0)); + rc= mysql_stmt_execute(stmt); + + DIE_UNLESS(rc && mysql_stmt_errno(stmt) == ER_UNKNOWN_ERROR); + + mysql_stmt_close(stmt); + + DBUG_VOID_RETURN; +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -18791,6 +18841,7 @@ static struct my_tests_st my_tests[]= { { "test_bug54041", test_bug54041 }, { "test_bug47485", test_bug47485 }, { "test_bug58036", test_bug58036 }, + { "test_bug56976", test_bug56976 }, { 0, 0 } }; -- cgit v1.2.1 From 4bb5d2dce4e48d1c5891b21efae6366020992325 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Thu, 17 Mar 2011 15:52:49 +0200 Subject: Bug #11766854: 60075: MYSQL_LOAD_CLIENT_PLUGIN DOESN'T CLEAR ERROR Added the cleanup code. Extended mysql_client_test to take --plugin-dir and --default_auth. Added a C test case. --- tests/mysql_client_test.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'tests') diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 7911393758c..b5326c5bee9 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -34,6 +34,7 @@ #include #include #include +#include #define VER "2.1" #define MAX_TEST_QUERY_LENGTH 300 /* MAX QUERY BUFFER LENGTH */ @@ -59,6 +60,7 @@ static unsigned int test_count= 0; static unsigned int opt_count= 0; static unsigned int iter_count= 0; static my_bool have_innodb= FALSE; +static char *opt_plugin_dir= 0, *opt_default_auth= 0; static const char *opt_basedir= "./"; static const char *opt_vardir= "mysql-test/var"; @@ -245,6 +247,11 @@ static MYSQL *mysql_client_init(MYSQL* con) if (res && shared_memory_base_name) mysql_options(res, MYSQL_SHARED_MEMORY_BASE_NAME, shared_memory_base_name); #endif + if (opt_plugin_dir && *opt_plugin_dir) + mysql_options(res, MYSQL_PLUGIN_DIR, opt_plugin_dir); + + if (opt_default_auth && *opt_default_auth) + mysql_options(res, MYSQL_DEFAULT_AUTH, opt_default_auth); return res; } @@ -326,6 +333,11 @@ static MYSQL* client_connect(ulong flag, uint protocol, my_bool auto_reconnect) /* enable local infile, in non-binary builds often disabled by default */ mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0); mysql_options(mysql, MYSQL_OPT_PROTOCOL, &protocol); + if (opt_plugin_dir && *opt_plugin_dir) + mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir); + + if (opt_default_auth && *opt_default_auth) + mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth); if (!(mysql_real_connect(mysql, opt_host, opt_user, opt_password, opt_db ? opt_db:"test", opt_port, @@ -19552,6 +19564,28 @@ static void test_bug57058() } +/** + Bug#11766854: 60075: MYSQL_LOAD_CLIENT_PLUGIN DOESN'T CLEAR ERROR +*/ + +static void test_bug11766854() +{ + struct st_mysql_client_plugin *plugin; + + DBUG_ENTER("test_bug11766854"); + myheader("test_bug11766854"); + + plugin= mysql_load_plugin(mysql, "foo", -1, 0); + DIE_UNLESS(plugin == 0); + + plugin= mysql_load_plugin(mysql, "qa_auth_client", -1, 0); + DIE_UNLESS(plugin != 0); + DIE_IF(mysql_errno(mysql)); + + DBUG_VOID_RETURN; +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -19609,6 +19643,12 @@ static struct my_option client_test_long_options[] = {"getopt-ll-test", 'g', "Option for testing bug in getopt library", &opt_getopt_ll_test, &opt_getopt_ll_test, 0, GET_LL, REQUIRED_ARG, 0, 0, LONGLONG_MAX, 0, 0, 0}, + {"plugin_dir", 0, "Directory for client-side plugins.", + (uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"default_auth", 0, "Default authentication client-side plugin to use.", + (uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -19889,6 +19929,7 @@ static struct my_tests_st my_tests[]= { { "test_bug58036", test_bug58036 }, { "test_bug57058", test_bug57058 }, { "test_bug56976", test_bug56976 }, + { "test_bug11766854", test_bug11766854 }, { 0, 0 } }; -- cgit v1.2.1 From 7117e0635c60f5db23ebb0f4b0866ce93b8ffaed Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Tue, 22 Mar 2011 14:48:56 +0300 Subject: A patch for Bug#11763413 (56115: SELECT doesn't work in prepared statements with cursor protocol). The problem was a bug in Materialized-cursor implementation. Materialized_cursor::open() called send_result_metadata() with items pointing to already closed table. The fix is to send metadata when the table is still open. NOTE: this is a "partial" fix: metadata are different with and without --cursor-protocol, but that's a different large problem, one indication of which is reported as Bug 24176. --- tests/mysql_client_test.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index b5326c5bee9..348ea9b6f29 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15694,8 +15694,11 @@ static void test_bug13488() check_execute(stmt1, rc); if (!opt_silent) - printf("data is: %s", (f1 == 1 && f2 == 1 && f3 == 2)?"OK": - "wrong"); + { + printf("data: f1: %d; f2: %d; f3: %d\n", f1, f2, f3); + printf("data is: %s\n", + (f1 == 1 && f2 == 1 && f3 == 2) ? "OK" : "wrong"); + } DIE_UNLESS(f1 == 1 && f2 == 1 && f3 == 2); rc= mysql_query(mysql, "drop table t1, t2"); myquery(rc); -- cgit v1.2.1 From 7ae92503c74c1843374146e8346fffc9568f1290 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Mon, 6 Jun 2011 13:27:05 +0300 Subject: Fixed cast warnings in introducing the pluggable authentication client options. --- tests/mysql_client_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 348ea9b6f29..e789831b3f2 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -19647,10 +19647,10 @@ static struct my_option client_test_long_options[] = &opt_getopt_ll_test, &opt_getopt_ll_test, 0, GET_LL, REQUIRED_ARG, 0, 0, LONGLONG_MAX, 0, 0, 0}, {"plugin_dir", 0, "Directory for client-side plugins.", - (uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0, + &opt_plugin_dir, &opt_plugin_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"default_auth", 0, "Default authentication client-side plugin to use.", - (uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0, + &opt_default_auth, &opt_default_auth, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; -- cgit v1.2.1 From eecaad9dccd790f82dc2c032d6bb8101feab1fdf Mon Sep 17 00:00:00 2001 From: Mayank Prasad Date: Fri, 10 Jun 2011 19:56:35 +0530 Subject: Bug#12337762 : MYSQL_LIST_FIELDS() RETURNS WRONG CHARSET FOR CHAR/VARCHAR/TEXT COLUMNS IN VIEWS Issue: charset value for a Column, returned by MYSQL_LIST_FIELDS(), was not same for Table and View. This was because, for view, field charset was not being returned. Solution: Added definition of function "charset_for_protocol()" in calss Item_ident_for_show to return field charset value. sql/item.h: Added definition for charset_for_protocol() function to return field charset. tests/mysql_client_test.c: Added a test case test_bug12337762 for the changes done. --- tests/mysql_client_test.c | 112 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 94 insertions(+), 18 deletions(-) (limited to 'tests') diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index e789831b3f2..5401e360f33 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -19588,6 +19588,81 @@ static void test_bug11766854() DBUG_VOID_RETURN; } +/** + Bug#12337762: 60075: MYSQL_LIST_FIELDS() RETURNS WRONG CHARSET FOR + CHAR/VARCHAR/TEXT COLUMNS IN VIEWS +*/ +static void test_bug12337762() +{ + int rc,i=0; + MYSQL_RES *result; + MYSQL_FIELD *field; + unsigned int tab_charsetnr[3]= {0}; + + DBUG_ENTER("test_bug12337762"); + myheader("test_bug12337762"); + + /* + Creating table with specific charset. + */ + rc= mysql_query(mysql, "drop table if exists charset_tab"); + rc= mysql_query(mysql, "create table charset_tab("\ + "txt1 varchar(32) character set Latin1,"\ + "txt2 varchar(32) character set Latin1 collate latin1_bin,"\ + "txt3 varchar(32) character set utf8 collate utf8_bin"\ + ")"); + + DIE_UNLESS(rc == 0); + DIE_IF(mysql_errno(mysql)); + + /* + Creating view from table created earlier. + */ + rc= mysql_query(mysql, "drop view if exists charset_view"); + rc= mysql_query(mysql, "create view charset_view as "\ + "select * from charset_tab;"); + DIE_UNLESS(rc == 0); + DIE_IF(mysql_errno(mysql)); + + /* + Checking field information for table. + */ + result= mysql_list_fields(mysql, "charset_tab", NULL); + DIE_IF(mysql_errno(mysql)); + i=0; + while((field= mysql_fetch_field(result))) + { + printf("field name %s\n", field->name); + printf("field table %s\n", field->table); + printf("field type %d\n", field->type); + printf("field charset %d\n", field->charsetnr); + tab_charsetnr[i++]= field->charsetnr; + printf("\n"); + } + mysql_free_result(result); + + /* + Checking field information for view. + */ + result= mysql_list_fields(mysql, "charset_view", NULL); + DIE_IF(mysql_errno(mysql)); + i=0; + while((field= mysql_fetch_field(result))) + { + printf("field name %s\n", field->name); + printf("field table %s\n", field->table); + printf("field type %d\n", field->type); + printf("field charset %d\n", field->charsetnr); + printf("\n"); + /* + charset value for field must be same for both, view and table. + */ + DIE_UNLESS(field->charsetnr == tab_charsetnr[i++]); + } + mysql_free_result(result); + + DBUG_VOID_RETURN; +} /* Read and parse arguments and MySQL options from my.cnf @@ -19933,6 +20008,7 @@ static struct my_tests_st my_tests[]= { { "test_bug57058", test_bug57058 }, { "test_bug56976", test_bug56976 }, { "test_bug11766854", test_bug11766854 }, + { "test_bug12337762", test_bug12337762 }, { 0, 0 } }; @@ -20071,29 +20147,29 @@ int main(int argc, char **argv) if (!argc) { for (fptr= my_tests; fptr->name; fptr++) - (*fptr->function)(); + (*fptr->function)(); } else { for ( ; *argv ; argv++) { - for (fptr= my_tests; fptr->name; fptr++) - { - if (!strcmp(fptr->name, *argv)) - { - (*fptr->function)(); - break; - } - } - if (!fptr->name) - { - fprintf(stderr, "\n\nGiven test not found: '%s'\n", *argv); - fprintf(stderr, "See legal test names with %s -T\n\nAborting!\n", - my_progname); - client_disconnect(mysql, 1); - free_defaults(defaults_argv); - exit(1); - } + for (fptr= my_tests; fptr->name; fptr++) + { + if (!strcmp(fptr->name, *argv)) + { + (*fptr->function)(); + break; + } + } + if (!fptr->name) + { + fprintf(stderr, "\n\nGiven test not found: '%s'\n", *argv); + fprintf(stderr, "See legal test names with %s -T\n\nAborting!\n", + my_progname); + client_disconnect(mysql, 1); + free_defaults(defaults_argv); + exit(1); + } } } -- cgit v1.2.1