mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge moonbone.local:/mnt/gentoo64/work/test-5.0-opt-mysql
into moonbone.local:/mnt/gentoo64/work/test-5.1-opt-mysql
This commit is contained in:
@ -16161,6 +16161,69 @@ static void test_bug27876()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Bug#28505: mysql_affected_rows() returns wrong value if CLIENT_FOUND_ROWS
|
||||
flag is set.
|
||||
*/
|
||||
static void test_bug28505()
|
||||
{
|
||||
MYSQL *l_mysql;
|
||||
my_bool error= 0;
|
||||
my_ulonglong res;
|
||||
|
||||
if (!(l_mysql= mysql_init(NULL)))
|
||||
{
|
||||
myerror("mysql_init() failed");
|
||||
DIE_UNLESS(1);
|
||||
}
|
||||
if (!(mysql_real_connect(l_mysql, opt_host, opt_user,
|
||||
opt_password, current_db, opt_port,
|
||||
opt_unix_socket, CLIENT_FOUND_ROWS)))
|
||||
{
|
||||
myerror("connection failed");
|
||||
error= 1;
|
||||
goto end;
|
||||
}
|
||||
l_mysql->reconnect= 1;
|
||||
if (mysql_query(l_mysql, "drop table if exists t1"))
|
||||
{
|
||||
myerror(NULL);
|
||||
error= 1;
|
||||
goto end;
|
||||
}
|
||||
if (mysql_query(l_mysql, "create table t1(f1 int primary key)"))
|
||||
{
|
||||
myerror(NULL);
|
||||
error= 1;
|
||||
goto end;
|
||||
}
|
||||
if (mysql_query(l_mysql, "insert into t1 values(1)"))
|
||||
{
|
||||
myerror(NULL);
|
||||
error= 1;
|
||||
goto end;
|
||||
}
|
||||
if (mysql_query(l_mysql,
|
||||
"insert into t1 values(1) on duplicate key update f1=1"))
|
||||
{
|
||||
myerror(NULL);
|
||||
error= 1;
|
||||
goto end;
|
||||
}
|
||||
res= mysql_affected_rows(l_mysql);
|
||||
if (!res)
|
||||
error= 1;
|
||||
if (mysql_query(l_mysql, "drop table t1"))
|
||||
{
|
||||
myerror(NULL);
|
||||
error= 1;
|
||||
}
|
||||
end:
|
||||
mysql_close(l_mysql);
|
||||
DIE_UNLESS(error == 0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Read and parse arguments and MySQL options from my.cnf
|
||||
*/
|
||||
@ -16442,6 +16505,7 @@ static struct my_tests_st my_tests[]= {
|
||||
{ "test_bug15518", test_bug15518 },
|
||||
{ "test_bug23383", test_bug23383 },
|
||||
{ "test_bug21635", test_bug21635 },
|
||||
{ "test_bug28505", test_bug28505 },
|
||||
{ "test_status", test_status },
|
||||
{ "test_bug24179", test_bug24179 },
|
||||
{ "test_ps_query_cache", test_ps_query_cache },
|
||||
|
Reference in New Issue
Block a user