Below is the list of changes that have just been committed into a local
5.1 repository of jani. When jani does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-10-03 20:08:39+03:00, jani@stripped +8 -0
Added more tests and purecov comments.
mysql-test/r/create.result@stripped, 2006-10-03 20:08:36+03:00,
jani@stripped +14 -0
Added tests for incorrect database names.
mysql-test/r/events.result@stripped, 2006-10-03 20:08:36+03:00,
jani@stripped +2 -0
Added tests for incorrect database names.
mysql-test/t/create.test@stripped, 2006-10-03 20:08:36+03:00,
jani@stripped +19 -0
Added tests for incorrect database names.
mysql-test/t/events.test@stripped, 2006-10-03 20:08:36+03:00,
jani@stripped +7 -0
Added tests for incorrect database names.
sql/item_timefunc.cc@stripped, 2006-10-03 20:08:36+03:00, jani@stripped
+4 -4
Added purecov comments.
sql/sql_parse.cc@stripped, 2006-10-03 20:08:36+03:00, jani@stripped +10
-1
Added purecov comments and #ifdefed out a block
of legacy code.
sql/table.cc@stripped, 2006-10-03 20:08:36+03:00, jani@stripped +1 -1
Added purecov comment.
tests/mysql_client_test.c@stripped, 2006-10-03 20:08:36+03:00,
jani@stripped +20 -1
Added test for (short) status.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jani
# Host: ua141d10.elisa.omakaista.fi
# Root: /home/my/bk/mysql-5.1-lex-string
--- 1.132/sql/item_timefunc.cc 2006-10-03 20:08:50 +03:00
+++ 1.133/sql/item_timefunc.cc 2006-10-03 20:08:50 +03:00
@@ -1250,8 +1250,8 @@
interval->second_part= array[1];
break;
case INTERVAL_LAST:
- DBUG_ASSERT(0);
- break;
+ DBUG_ASSERT(0); /* purecov: deadcode */
+ break; /* purecov: deadcode */
}
return 0;
}
@@ -2091,7 +2091,7 @@
case INTERVAL_HOUR_MICROSECOND: max_length=13; date_value=0; break;
case INTERVAL_MINUTE_MICROSECOND: max_length=11; date_value=0; break;
case INTERVAL_SECOND_MICROSECOND: max_length=9; date_value=0; break;
- case INTERVAL_LAST: DBUG_ASSERT(0); break;
+ case INTERVAL_LAST: DBUG_ASSERT(0); break; /* purecov: deadcode */
}
}
@@ -2161,7 +2161,7 @@
ltime.second_part)*neg;
case INTERVAL_SECOND_MICROSECOND: return ((longlong)ltime.second*1000000L+
ltime.second_part)*neg;
- case INTERVAL_LAST: DBUG_ASSERT(0); break;
+ case INTERVAL_LAST: DBUG_ASSERT(0); break; /* purecov: deadcode */
}
return 0; // Impossible
}
--- 1.580/sql/sql_parse.cc 2006-10-03 20:08:50 +03:00
+++ 1.581/sql/sql_parse.cc 2006-10-03 20:08:50 +03:00
@@ -1327,6 +1327,7 @@
We got only a part of the current string. Will try to increase
net buffer then read the rest of the current string.
*/
+ /* purecov: begin tested */
if (net_realloc(&(thd->net), 2 * thd->net.max_packet))
{
net_send_error(thd, ER_NET_PACKET_TOO_LARGE, NullS);
@@ -1336,9 +1337,10 @@
buff= (char*) thd->net.buff;
fgets(buff + length, thd->net.max_packet - length, file);
length+= (ulong) strlen(buff + length);
+ /* purecov: end */
}
if (thd->is_fatal_error)
- break;
+ break; /* purecov: inspected */
while (length && (my_isspace(thd->charset(), buff[length-1]) ||
buff[length-1] == ';'))
@@ -1962,6 +1964,7 @@
error=TRUE; // End server
break;
+#ifdef REMOVED
case COM_CREATE_DB: // QQ: To be removed
{
LEX_STRING db, alias;
@@ -2009,6 +2012,7 @@
mysql_rm_db(thd, db.str, 0, 0);
break;
}
+#endif
#ifndef EMBEDDED_LIBRARY
case COM_BINLOG_DUMP:
{
@@ -3863,6 +3867,11 @@
break;
}
#endif
+ if (check_db_name(newdb))
+ {
+ my_error(ER_WRONG_DB_NAME, MYF(0), newdb->str);
+ break;
+ }
if (check_access(thd,ALTER_ACL,olddb->str,0,1,0,is_schema_db(olddb->str)) ||
check_access(thd,DROP_ACL,olddb->str,0,1,0,is_schema_db(olddb->str)) ||
check_access(thd,CREATE_ACL,newdb->str,0,1,0,is_schema_db(newdb->str)))
--- 1.241/sql/table.cc 2006-10-03 20:08:50 +03:00
+++ 1.242/sql/table.cc 2006-10-03 20:08:50 +03:00
@@ -2272,7 +2272,7 @@
}
else
#endif
- return org_name->str[org_name->length - 1] != ' ';
+ return org_name->str[org_name->length - 1] != ' '; /* purecov: inspected */
}
--- 1.36/mysql-test/r/events.result 2006-10-03 20:08:50 +03:00
+++ 1.37/mysql-test/r/events.result 2006-10-03 20:08:50 +03:00
@@ -386,4 +386,6 @@
ERROR 0A000: Not allowed to return a result set from a trigger
drop table t1;
drop event e1;
+SHOW EVENTS FROM
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
+ERROR 42000: Incorrect database name
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
drop database events_test;
--- 1.32/mysql-test/t/events.test 2006-10-03 20:08:50 +03:00
+++ 1.33/mysql-test/t/events.test 2006-10-03 20:08:50 +03:00
@@ -378,4 +378,11 @@
##show processlist;
##select count(*) from mysql.event;
+#
+# Test wrong syntax
+#
+
+--error 1102
+SHOW EVENTS FROM
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
+
drop database events_test;
--- 1.125/mysql-test/r/create.result 2006-10-03 20:08:50 +03:00
+++ 1.126/mysql-test/r/create.result 2006-10-03 20:08:50 +03:00
@@ -818,3 +818,17 @@
a b
1 1
drop table t1,t2;
+CREATE DATABASE
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
+ERROR 42000: Incorrect database name
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+DROP DATABASE
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
+ERROR 42000: Incorrect database name
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+RENAME DATABASE
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
TO a;
+ERROR 42000: Unknown database
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+RENAME DATABASE mysqltest TO
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
+ERROR 42000: Incorrect database name
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+create database mysqltest;
+RENAME DATABASE mysqltest TO
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
+ERROR 42000: Incorrect database name
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+drop database mysqltest;
+USE
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
+ERROR 42000: Incorrect database name
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
--- 1.83/mysql-test/t/create.test 2006-10-03 20:08:50 +03:00
+++ 1.84/mysql-test/t/create.test 2006-10-03 20:08:50 +03:00
@@ -706,3 +706,22 @@
INSERT INTO t2 select * from t1;
SELECT * from t2;
drop table t1,t2;
+
+#
+# Test incorrect database names
+#
+
+--error 1102
+CREATE DATABASE
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
+--error 1102
+DROP DATABASE
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
+--error 1049
+RENAME DATABASE
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
TO a;
+--error 1102
+RENAME DATABASE mysqltest TO
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
+create database mysqltest;
+--error 1102
+RENAME DATABASE mysqltest TO
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
+drop database mysqltest;
+--error 1102
+USE
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
--- 1.205/tests/mysql_client_test.c 2006-10-03 20:08:50 +03:00
+++ 1.206/tests/mysql_client_test.c 2006-10-03 20:08:50 +03:00
@@ -15297,7 +15297,7 @@
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 +15392,24 @@
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");
+ die(__FILE__, __LINE__, "mysql_stat failed");
+ }
+ DBUG_VOID_RETURN;
+}
+
/*
Read and parse arguments and MySQL options from my.cnf
@@ -15669,6 +15687,7 @@
{ "test_mysql_insert_id", test_mysql_insert_id },
{ "test_bug19671", test_bug19671},
{ "test_bug21206", test_bug21206},
+ { "test_status", test_status},
{ 0, 0 }
};
| Thread |
|---|
| • bk commit into 5.1 tree (jani:1.2281) | jani | 3 Oct |