summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorunknown <jani@ua141d10.elisa.omakaista.fi>2006-10-16 19:57:33 +0300
committerunknown <jani@ua141d10.elisa.omakaista.fi>2006-10-16 19:57:33 +0300
commite94087c5ddc3f5b61ce69cfd51240d1a16999597 (patch)
tree41ed5c3ff46289c94adeb49c1b9ebe71aba20dd7 /tests
parent1b6858ea50c55bfff29d9796aed91166eda2b4ea (diff)
downloadmariadb-git-e94087c5ddc3f5b61ce69cfd51240d1a16999597.tar.gz
Changed several char* to LEX_STRING*.
BUILD/SETUP.sh: Added check for CCACHE_DISABLE. If set, do not use ccache at all. BUILD/compile-pentium-gcov: Moved CCACHE_DISABLE up before going into SETUP.sh. Added debug_extra_flags to extra_flags. mysql-test/r/create.result: Added tests for incorrect database names. mysql-test/r/ctype_create.result: Added tests for incorrect alter database names. mysql-test/r/events.result: Added tests for incorrect database names. mysql-test/r/grant.result: Output changed to capital letters. mysql-test/t/alter_table.test: Removed extra empty line mysql-test/t/create.test: Added tests for incorrect database names. mysql-test/t/ctype_create.test: Added tests for incorrect name handling mysql-test/t/events.test: Added tests for incorrect database names. sql/item_timefunc.cc: Added dummy case to avoid compiler warning. sql/mysql_priv.h: Changed argument from char pointer to LEX_STRING pointer. sql/mysqld.cc: Added a missing component from struct. sql/sql_class.h: Added function LEX_STRING_make that sets the string and length. sql/sql_db.cc: Changed several char pointers to lex_strings. sql/sql_lex.cc: name is now LEX_STRING sql/sql_lex.h: Changed name to LEX_STRING. sql/sql_parse.cc: Changed several char pointers to lex_strings. db_length needed a trick, because in old client protocol there was an extra char zero added to the string. check_db_name() now takes LEX_STRING pointer as an argument. Changed remove_escape() to take LEX_STRING pointer as an argument. Removed COM_CREATE_DB and COM_DROP_DB. These are obsolete. sql/sql_table.cc: char* -> LEX_STRING* sql/sql_yacc.yy: Changed char* -> LEX_STRING* sql/table.cc: check_db_name() now takes LEX_STRING* as argument instead of char*. Optimized code a bit. tests/mysql_client_test.c: Added test for (short) status. After defining out (ifdef) COM_DROP_DB and COM_CREATE_DB in mysqld.cc mysql_client_test needed to be informed that failing in recognizing these commands is not fatal error anymore.
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 02170f6aacb..669a6b74ba6 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -33,6 +33,7 @@
#include <errmsg.h>
#include <my_getopt.h>
#include <m_string.h>
+#include <mysqld_error.h>
#define VER "2.1"
#define MAX_TEST_QUERY_LENGTH 300 /* MAX QUERY BUFFER LENGTH */
@@ -11990,13 +11991,21 @@ static void test_bug6081()
rc= simple_command(mysql, COM_DROP_DB, current_db,
(ulong)strlen(current_db), 0);
- myquery(rc);
+ if (rc == 0 && mysql_errno(mysql) != ER_UNKNOWN_COM_ERROR)
+ {
+ myerror(NULL); /* purecov: inspected */
+ die(__FILE__, __LINE__, "COM_DROP_DB failed"); /* purecov: inspected */
+ }
rc= simple_command(mysql, COM_DROP_DB, current_db,
(ulong)strlen(current_db), 0);
myquery_r(rc);
rc= simple_command(mysql, COM_CREATE_DB, current_db,
(ulong)strlen(current_db), 0);
- myquery(rc);
+ if (rc == 0 && mysql_errno(mysql) != ER_UNKNOWN_COM_ERROR)
+ {
+ myerror(NULL); /* purecov: inspected */
+ die(__FILE__, __LINE__, "COM_CREATE_DB failed"); /* purecov: inspected */
+ }
rc= simple_command(mysql, COM_CREATE_DB, current_db,
(ulong)strlen(current_db), 0);
myquery_r(rc);
@@ -15297,7 +15306,7 @@ static void test_bug15752()
MYSQL mysql_local;
int rc, i;
const int ITERATION_COUNT= 100;
- char *query= "CALL p1()";
+ const char *query= "CALL p1()";
myheader("test_bug15752");
@@ -15392,6 +15401,24 @@ static void test_bug21206()
DBUG_VOID_RETURN;
}
+/*
+ Ensure we execute the status code while testing
+*/
+
+static void test_status()
+{
+ const char *status;
+ DBUG_ENTER("test_status");
+ myheader("test_status");
+
+ if (!(status= mysql_stat(mysql)))
+ {
+ myerror("mysql_stat failed"); /* purecov: inspected */
+ die(__FILE__, __LINE__, "mysql_stat failed"); /* purecov: inspected */
+ }
+ DBUG_VOID_RETURN;
+}
+
/*
Read and parse arguments and MySQL options from my.cnf
@@ -15669,6 +15696,7 @@ static struct my_tests_st my_tests[]= {
{ "test_mysql_insert_id", test_mysql_insert_id },
{ "test_bug19671", test_bug19671},
{ "test_bug21206", test_bug21206},
+ { "test_status", test_status},
{ 0, 0 }
};