summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2006-02-02 23:27:06 +0300
committerunknown <konstantin@mysql.com>2006-02-02 23:27:06 +0300
commitd297a221fe57486f0fd82e0cf3e7b0e923adee93 (patch)
tree8b23d2acce88a26d289057d5119ca3944903d88f /tests
parent5610e9ab8296f661b144bc64702bb612d2038050 (diff)
parent333b1f8594922647278808a4c114c16695551343 (diff)
downloadmariadb-git-d297a221fe57486f0fd82e0cf3e7b0e923adee93.tar.gz
Merge mysql.com:/home/kostja/mysql/tmp_merge
into mysql.com:/home/kostja/mysql/mysql-5.1-merge BitKeeper/etc/ignore: auto-union configure.in: Auto merged libmysql/libmysql.c: Auto merged mysql-test/ndb/ndbcluster.sh: Auto merged mysql-test/r/rpl_sp.result: Auto merged mysql-test/r/sp-error.result: Auto merged mysql-test/r/sp.result: Auto merged mysql-test/r/type_float.result: Auto merged mysql-test/t/rpl_sp.test: Auto merged mysql-test/t/sp-error.test: Auto merged mysql-test/t/sp.test: Auto merged sql/field.cc: Auto merged sql/item_func.cc: Auto merged sql/mysqld.cc: Auto merged sql/protocol.cc: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_acl.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged storage/myisam/ft_update.c: Auto merged storage/ndb/include/logger/LogHandler.hpp: Auto merged storage/ndb/include/logger/Logger.hpp: Auto merged storage/ndb/include/mgmapi/mgmapi.h: Auto merged storage/ndb/include/mgmcommon/ConfigRetriever.hpp: Auto merged storage/ndb/src/common/logger/FileLogHandler.cpp: Auto merged storage/ndb/src/common/logger/LogHandler.cpp: Auto merged storage/ndb/src/common/logger/Logger.cpp: Auto merged storage/ndb/src/common/logger/SysLogHandler.cpp: Auto merged storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp: Auto merged storage/ndb/src/common/util/SocketServer.cpp: Auto merged storage/ndb/src/kernel/main.cpp: Auto merged storage/ndb/src/kernel/vm/Configuration.cpp: Auto merged storage/ndb/src/kernel/vm/Configuration.hpp: Auto merged storage/ndb/src/mgmapi/mgmapi.cpp: Auto merged storage/ndb/src/mgmclient/CommandInterpreter.cpp: Auto merged storage/ndb/src/mgmsrv/MgmtSrvr.cpp: Auto merged storage/ndb/src/mgmsrv/MgmtSrvr.hpp: Auto merged storage/ndb/src/mgmsrv/Services.cpp: Auto merged storage/ndb/src/mgmsrv/Services.hpp: Auto merged storage/ndb/src/mgmsrv/main.cpp: Auto merged storage/ndb/tools/ndb_size.pl: Auto merged zlib/Makefile.am: Auto merged mysql-test/r/information_schema.result: SCCS merged mysql-test/t/information_schema.test: Manual merge. sql/ha_archive.cc: Manual merge. sql/share/errmsg.txt: SCCS merged tests/mysql_client_test.c: Manual merge.
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c84
1 files changed, 82 insertions, 2 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index d33654d8810..e118289101e 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -14697,8 +14697,87 @@ static void test_opt_reconnect()
mysql_close(lmysql);
}
+/* Bug #16144: mysql_stmt_attr_get type error */
+
+static void test_bug16144()
+{
+ const my_bool flag_orig= (my_bool) 0xde;
+ my_bool flag= flag_orig;
+ MYSQL_STMT *stmt;
+ myheader("test_bug16144");
+
+ /* Check that attr_get returns correct data on little and big endian CPUs */
+ stmt= mysql_stmt_init(mysql);
+ mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (const void*) &flag);
+ mysql_stmt_attr_get(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void*) &flag);
+ DIE_UNLESS(flag == flag_orig);
+ mysql_stmt_close(stmt);
+}
/*
+ Bug #15613: "libmysqlclient API function mysql_stmt_prepare returns wrong
+ field length"
+*/
+
+static void test_bug15613()
+{
+ MYSQL_STMT *stmt;
+ const char *stmt_text;
+ MYSQL_RES *metadata;
+ MYSQL_FIELD *field;
+ int rc;
+ myheader("test_bug15613");
+
+ /* I. Prepare the table */
+ rc= mysql_query(mysql, "set names latin1");
+ myquery(rc);
+ mysql_query(mysql, "drop table if exists t1");
+ rc= mysql_query(mysql,
+ "create table t1 (t text character set utf8, "
+ "tt tinytext character set utf8, "
+ "mt mediumtext character set utf8, "
+ "lt longtext character set utf8, "
+ "vl varchar(255) character set latin1,"
+ "vb varchar(255) character set binary,"
+ "vu varchar(255) character set utf8)");
+ myquery(rc);
+
+ stmt= mysql_stmt_init(mysql);
+
+ /* II. Check SELECT metadata */
+ stmt_text= ("select t, tt, mt, lt, vl, vb, vu from t1");
+ rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+ metadata= mysql_stmt_result_metadata(stmt);
+ field= mysql_fetch_fields(metadata);
+ if (!opt_silent)
+ {
+ printf("Field lengths (client character set is latin1):\n"
+ "text character set utf8:\t\t%lu\n"
+ "tinytext character set utf8:\t\t%lu\n"
+ "mediumtext character set utf8:\t\t%lu\n"
+ "longtext character set utf8:\t\t%lu\n"
+ "varchar(255) character set latin1:\t%lu\n"
+ "varchar(255) character set binary:\t%lu\n"
+ "varchar(255) character set utf8:\t%lu\n",
+ field[0].length, field[1].length, field[2].length, field[3].length,
+ field[4].length, field[5].length, field[6].length);
+ }
+ DIE_UNLESS(field[0].length == 65535);
+ DIE_UNLESS(field[1].length == 255);
+ DIE_UNLESS(field[2].length == 16777215);
+ DIE_UNLESS(field[3].length == 4294967295UL);
+ DIE_UNLESS(field[4].length == 255);
+ DIE_UNLESS(field[5].length == 255);
+ DIE_UNLESS(field[6].length == 255);
+
+ /* III. Cleanup */
+ rc= mysql_query(mysql, "drop table t1");
+ myquery(rc);
+ rc= mysql_query(mysql, "set names default");
+ myquery(rc);
+ mysql_stmt_close(stmt);
+}
+/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -14957,9 +15036,10 @@ static struct my_tests_st my_tests[]= {
{ "test_bug13488", test_bug13488 },
{ "test_bug13524", test_bug13524 },
{ "test_bug14845", test_bug14845 },
- { "test_bug15510", test_bug15510 },
{ "test_opt_reconnect", test_opt_reconnect },
-
+ { "test_bug15510", test_bug15510},
+ { "test_bug16144", test_bug16144 },
+ { "test_bug15613", test_bug15613 },
{ 0, 0 }
};