embedded-mode tests fixed

parent c7866bd5
......@@ -10,7 +10,7 @@
top_builddir=../..
mysql_test_dir=$top_builddir/mysql-test
examples=$top_builddir/libmysqld/examples
mysqltest=$examples/mysqltest
mysqltest=$examples/mysqltest_embedded
datadir=$mysql_test_dir/var/master-data
test_data_dir=test
gdb=0
......
......@@ -517,6 +517,7 @@ void *create_embedded_thd(int client_flag)
thd->set_time();
thd->init_for_queries();
thd->client_capabilities= client_flag;
thd->real_id= (pthread_t) thd;
thd->db= NULL;
thd->db_length= 0;
......@@ -815,6 +816,9 @@ void Protocol_simple::prepare_for_resend()
DBUG_ENTER("send_data");
if (!thd->mysql) // bootstrap file handling
DBUG_VOID_RETURN;
if (!data)
{
if (!(data= (MYSQL_DATA*) my_malloc(sizeof(MYSQL_DATA),
......
......@@ -1299,6 +1299,7 @@ drop table test_checksum;
set foreign_key_checks=0;
create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
--replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ /
-- error 1005
create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
set foreign_key_checks=1;
......@@ -1309,6 +1310,7 @@ drop table t2;
set foreign_key_checks=0;
create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
--replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ /
-- error 1005
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
set foreign_key_checks=1;
......@@ -1338,6 +1340,7 @@ drop table t2,t1;
set foreign_key_checks=0;
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;
--replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ /
-- error 1025
rename table t3 to t1;
set foreign_key_checks=1;
......
......@@ -2238,7 +2238,11 @@ longlong Item_func_release_lock::val_int()
}
else
{
#ifdef EMBEDDED_LIBRARY
if (ull->locked && pthread_equal(current_thd->real_id,ull->thread))
#else
if (ull->locked && pthread_equal(pthread_self(),ull->thread))
#endif
{
result=1; // Release is ok
item_user_lock_release(ull);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment