Browse Source
Merge xiphis.org:/anubis/antony/work/p2-bug25714.1
Merge xiphis.org:/anubis/antony/work/p2-bug25714.1
into xiphis.org:/anubis/antony/work/p2-bug25714.1.merge-5.0pull/374/head
8 changed files with 207 additions and 4 deletions
-
7mysql-test/include/have_bug25714.inc
-
12mysql-test/mysql-test-run.pl
-
56mysql-test/r/federated_bug_25714.result
-
2mysql-test/r/have_bug25714.require
-
47mysql-test/t/federated_bug_25714.test
-
14sql/ha_federated.cc
-
5tests/Makefile.am
-
68tests/bug25714.c
@ -0,0 +1,7 @@ |
|||
# |
|||
# Check if the variable MYSQL_BUG25714 is set |
|||
# |
|||
--require r/have_bug25714.require |
|||
disable_query_log; |
|||
eval select LENGTH("MYSQL_BUG25714") > 0 as "have_bug25714_exe"; |
|||
enable_query_log; |
|||
@ -0,0 +1,56 @@ |
|||
stop slave; |
|||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; |
|||
reset master; |
|||
reset slave; |
|||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; |
|||
start slave; |
|||
stop slave; |
|||
DROP DATABASE IF EXISTS federated; |
|||
CREATE DATABASE federated; |
|||
DROP DATABASE IF EXISTS federated; |
|||
CREATE DATABASE federated; |
|||
DROP TABLE IF EXISTS federated.bug_13118_table; |
|||
CREATE TABLE federated.t1 ( |
|||
`id` int auto_increment primary key, |
|||
`value` int |
|||
) ENGINE=MyISAM; |
|||
INSERT INTO federated.t1 SET value=1; |
|||
INSERT INTO federated.t1 SET value=2; |
|||
INSERT INTO federated.t1 SET value=2; |
|||
DROP TABLE IF EXISTS federated.t1; |
|||
CREATE TABLE federated.t1 ( |
|||
`id` int auto_increment primary key, |
|||
`value` int |
|||
) ENGINE=FEDERATED |
|||
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; |
|||
SELECT * from federated.t1; |
|||
id value |
|||
1 1 |
|||
2 2 |
|||
3 2 |
|||
INSERT INTO federated.t1 SET value=4; |
|||
SELECT LAST_INSERT_ID(); |
|||
LAST_INSERT_ID() |
|||
4 |
|||
|
|||
5 inserted |
|||
6 inserted |
|||
|
|||
7 inserted |
|||
8 inserted |
|||
SELECT * from federated.t1; |
|||
id value |
|||
1 1 |
|||
2 2 |
|||
3 2 |
|||
4 4 |
|||
5 54 |
|||
6 55 |
|||
7 54 |
|||
8 55 |
|||
DROP TABLE federated.t1; |
|||
DROP TABLE federated.t1; |
|||
DROP TABLE IF EXISTS federated.t1; |
|||
DROP DATABASE IF EXISTS federated; |
|||
DROP TABLE IF EXISTS federated.t1; |
|||
DROP DATABASE IF EXISTS federated; |
|||
@ -0,0 +1,2 @@ |
|||
have_bug25714_exe |
|||
1 |
|||
@ -0,0 +1,47 @@ |
|||
--source include/have_bug25714.inc |
|||
source include/federated.inc; |
|||
|
|||
|
|||
connection slave; |
|||
--disable_warnings |
|||
DROP TABLE IF EXISTS federated.bug_13118_table; |
|||
--enable_warnings |
|||
|
|||
CREATE TABLE federated.t1 ( |
|||
`id` int auto_increment primary key, |
|||
`value` int |
|||
) ENGINE=MyISAM; |
|||
INSERT INTO federated.t1 SET value=1; |
|||
INSERT INTO federated.t1 SET value=2; |
|||
INSERT INTO federated.t1 SET value=2; |
|||
|
|||
connection master; |
|||
--disable_warnings |
|||
DROP TABLE IF EXISTS federated.t1; |
|||
--enable_warnings |
|||
|
|||
--replace_result $SLAVE_MYPORT SLAVE_PORT |
|||
eval CREATE TABLE federated.t1 ( |
|||
`id` int auto_increment primary key, |
|||
`value` int |
|||
) ENGINE=FEDERATED |
|||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; |
|||
|
|||
SELECT * from federated.t1; |
|||
|
|||
INSERT INTO federated.t1 SET value=4; |
|||
|
|||
SELECT LAST_INSERT_ID(); |
|||
|
|||
--exec $MYSQL_BUG25714 $SLAVE_MYPORT |
|||
--exec $MYSQL_BUG25714 $MASTER_MYPORT |
|||
|
|||
SELECT * from federated.t1; |
|||
|
|||
DROP TABLE federated.t1; |
|||
connection slave; |
|||
DROP TABLE federated.t1; |
|||
|
|||
|
|||
source include/federated_cleanup.inc; |
|||
|
|||
@ -0,0 +1,68 @@ |
|||
/* Copyright (C) 2007 MySQL AB |
|||
|
|||
This program is free software; you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation; version 2 of the License. |
|||
|
|||
This program is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with this program; if not, write to the Free Software |
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ |
|||
|
|||
#include <mysql.h> |
|||
#include <string.h> |
|||
#include <stdio.h> |
|||
#include <stdlib.h> |
|||
#include <assert.h> |
|||
|
|||
int main (int argc, char **argv) |
|||
{ |
|||
MYSQL conn; |
|||
int OK; |
|||
|
|||
const char* query4= "INSERT INTO federated.t1 SET Value=54"; |
|||
const char* query5= "INSERT INTO federated.t1 SET Value=55"; |
|||
|
|||
if (argc != 2) |
|||
return -1; |
|||
|
|||
mysql_init(&conn); |
|||
if (!mysql_real_connect( |
|||
&conn, |
|||
"127.0.0.1", |
|||
"root", |
|||
"", |
|||
"test", |
|||
atoi(argv[1]), |
|||
NULL, |
|||
CLIENT_FOUND_ROWS)) |
|||
{ |
|||
fprintf(stderr, "Failed to connect to database: Error: %s\n", |
|||
mysql_error(&conn)); |
|||
return 1; |
|||
} else { |
|||
printf("%s\n", mysql_error(&conn)); |
|||
} |
|||
|
|||
OK = mysql_real_query (&conn, query4, strlen(query4)); |
|||
|
|||
assert(0 == OK); |
|||
|
|||
printf("%ld inserted\n", |
|||
(long) mysql_insert_id(&conn)); |
|||
|
|||
OK = mysql_real_query (&conn, query5, strlen(query5)); |
|||
|
|||
assert(0 == OK); |
|||
|
|||
printf("%ld inserted\n", |
|||
(long) mysql_insert_id(&conn)); |
|||
|
|||
mysql_close(&conn); |
|||
|
|||
return 0; |
|||
}; |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue