Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d0603db7
Commit
d0603db7
authored
Mar 15, 2005
by
patg@krsna
Browse files
Options
Browse Files
Download
Plain Diff
Merge pgalbraith@bk-internal.mysql.com:/home/bk/mysql-5.0
into krsna.:/home/patg/test/mysql-5.0
parents
ce564b2d
24bc8624
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
416 additions
and
42 deletions
+416
-42
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
mysql-test/r/federated.result
mysql-test/r/federated.result
+114
-2
mysql-test/t/federated.test
mysql-test/t/federated.test
+146
-18
sql/ha_federated.cc
sql/ha_federated.cc
+155
-22
No files found.
BitKeeper/etc/logging_ok
View file @
d0603db7
...
...
@@ -182,6 +182,7 @@ ndbdev@shark.
nick@mysql.com
nick@nick.leippe.com
papa@gbichot.local
patg@krsna.
patg@krsna.patg.net
patg@patrick-galbraiths-computer.local
patg@pc248.lfp.kcls.org
...
...
mysql-test/r/federated.result
View file @
d0603db7
...
...
@@ -8,6 +8,120 @@ stop slave;
DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`name` varchar(32) NOT NULL default ''
)
DEFAULT CHARSET=latin1;
DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@127.0.0.1:@/too/many/items/federated/t1';
ERROR HY000: Can't create table 'this connection string is not in the correct format!
' (errno: 0)
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@127.0.0.1';
ERROR HY000: Can't create table 'this connection string is not in the correct format!
' (errno: 0)
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t3';
ERROR HY000: Error running query on master: foreign table 't3' does not exist!
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://user:pass@127.0.0.1:SLAVE_PORT/federated/t1';
ERROR 08S01: Error connecting to master: unable to connect to database 'federated' on host '127.0.0.1 as user 'user' !
DROP TABLE IF EXISTS federated.t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
INSERT INTO federated.t1 (id, name) VALUES (1, 'foo');
INSERT INTO federated.t1 (id, name) VALUES (2, 'fee');
SELECT * FROM federated.t1;
id name
1 foo
2 fee
DELETE FROM federated.t1;
DROP TABLE federated.t1;
DROP TABLE IF EXISTS federated.t2;
Warnings:
Note 1051 Unknown table 't2'
CREATE TABLE federated.t2 (
`id` int(20) NOT NULL,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
INSERT INTO federated.t2 (id, name) VALUES (1, 'foo');
INSERT INTO federated.t2 (id, name) VALUES (2, 'fee');
SELECT * FROM federated.t2;
id name
1 foo
2 fee
DROP TABLE federated.t2;
DROP TABLE IF EXISTS federated.t1;
DROP TABLE IF EXISTS federated.`t1%`;
Warnings:
Note 1051 Unknown table 't1%'
CREATE TABLE federated.`t1%` (
`id` int(20) NOT NULL,
`name` varchar(32) NOT NULL default ''
)
DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS federated.t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1%';
INSERT INTO federated.t1 (id, name) VALUES (1, 'foo');
INSERT INTO federated.t1 (id, name) VALUES (2, 'fee');
SELECT * FROM federated.t1;
id name
1 foo
2 fee
DELETE FROM federated.t1;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.`t1%` (
`id` int(20) NOT NULL,
`name` varchar(32) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
COMMENT='mysql://root@127.0.0.1:9308/federated/t1%';
INSERT INTO federated.`t1%` (id, name) VALUES (1, 'foo');
INSERT INTO federated.`t1%` (id, name) VALUES (2, 'fee');
SELECT * FROM federated.`t1%`;
id name
1 foo
2 fee
DELETE FROM federated.`t1%`;
DROP TABLE IF EXISTS federated.`t1%`;
DROP TABLE IF EXISTS federated.`t1%`;
DROP TABLE IF EXISTS federated.t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL auto_increment,
`name` varchar(32) NOT NULL default '',
`other` int(20) NOT NULL default '0',
...
...
@@ -16,8 +130,6 @@ PRIMARY KEY (`id`),
KEY `name` (`name`),
KEY `other_key` (`other`))
DEFAULT CHARSET=latin1;
DROP DATABASE IF EXISTS federated;
CREATE DATABASE federated;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL auto_increment,
`name` varchar(32) NOT NULL default '',
...
...
mysql-test/t/federated.test
View file @
d0603db7
...
...
@@ -14,7 +14,136 @@ DROP DATABASE IF EXISTS federated;
--
enable_warnings
CREATE
DATABASE
federated
;
CREATE
TABLE
federated
.
t1
(
`id`
int
(
20
)
NOT
NULL
,
`name`
varchar
(
32
)
NOT
NULL
default
''
)
DEFAULT
CHARSET
=
latin1
;
connection
master
;
--
disable_warnings
DROP
DATABASE
IF
EXISTS
federated
;
--
enable_warnings
CREATE
DATABASE
federated
;
# test too many items (malformed) in the comment string url
--
error
1005
eval
CREATE
TABLE
federated
.
t1
(
`id`
int
(
20
)
NOT
NULL
,
`name`
varchar
(
32
)
NOT
NULL
default
''
)
ENGINE
=
"FEDERATED"
DEFAULT
CHARSET
=
latin1
COMMENT
=
'mysql://root@127.0.0.1:@/too/many/items/federated/t1'
;
# test not enough items (malformed) in the comment string url
--
error
1005
eval
CREATE
TABLE
federated
.
t1
(
`id`
int
(
20
)
NOT
NULL
,
`name`
varchar
(
32
)
NOT
NULL
default
''
)
ENGINE
=
"FEDERATED"
DEFAULT
CHARSET
=
latin1
COMMENT
=
'mysql://root@127.0.0.1'
;
# test non-existant table
--
replace_result
$SLAVE_MYPORT
SLAVE_PORT
--
error
1219
eval
CREATE
TABLE
federated
.
t1
(
`id`
int
(
20
)
NOT
NULL
,
`name`
varchar
(
32
)
NOT
NULL
default
''
)
ENGINE
=
"FEDERATED"
DEFAULT
CHARSET
=
latin1
COMMENT
=
'mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t3'
;
# test bad user/password
--
replace_result
$SLAVE_MYPORT
SLAVE_PORT
--
error
1218
eval
CREATE
TABLE
federated
.
t1
(
`id`
int
(
20
)
NOT
NULL
,
`name`
varchar
(
32
)
NOT
NULL
default
''
)
ENGINE
=
"FEDERATED"
DEFAULT
CHARSET
=
latin1
COMMENT
=
'mysql://user:pass@127.0.0.1:$SLAVE_MYPORT/federated/t1'
;
DROP
TABLE
IF
EXISTS
federated
.
t1
;
# # correct connection, same named tables
--
replace_result
$SLAVE_MYPORT
SLAVE_PORT
eval
CREATE
TABLE
federated
.
t1
(
`id`
int
(
20
)
NOT
NULL
,
`name`
varchar
(
32
)
NOT
NULL
default
''
)
ENGINE
=
"FEDERATED"
DEFAULT
CHARSET
=
latin1
COMMENT
=
'mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'
;
INSERT
INTO
federated
.
t1
(
id
,
name
)
VALUES
(
1
,
'foo'
);
INSERT
INTO
federated
.
t1
(
id
,
name
)
VALUES
(
2
,
'fee'
);
SELECT
*
FROM
federated
.
t1
;
DELETE
FROM
federated
.
t1
;
DROP
TABLE
federated
.
t1
;
# correct connection, differently named tables
DROP
TABLE
IF
EXISTS
federated
.
t2
;
--
replace_result
$SLAVE_MYPORT
SLAVE_PORT
eval
CREATE
TABLE
federated
.
t2
(
`id`
int
(
20
)
NOT
NULL
,
`name`
varchar
(
32
)
NOT
NULL
default
''
)
ENGINE
=
"FEDERATED"
DEFAULT
CHARSET
=
latin1
COMMENT
=
'mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'
;
INSERT
INTO
federated
.
t2
(
id
,
name
)
VALUES
(
1
,
'foo'
);
INSERT
INTO
federated
.
t2
(
id
,
name
)
VALUES
(
2
,
'fee'
);
SELECT
*
FROM
federated
.
t2
;
DROP
TABLE
federated
.
t2
;
connection
slave
;
DROP
TABLE
IF
EXISTS
federated
.
t1
;
DROP
TABLE
IF
EXISTS
federated
.
`t1%`
;
CREATE
TABLE
federated
.
`t1%`
(
`id`
int
(
20
)
NOT
NULL
,
`name`
varchar
(
32
)
NOT
NULL
default
''
)
DEFAULT
CHARSET
=
latin1
;
connection
master
;
DROP
TABLE
IF
EXISTS
federated
.
t1
;
--
replace_result
$SLAVE_MYPORT
SLAVE_PORT
eval
CREATE
TABLE
federated
.
t1
(
`id`
int
(
20
)
NOT
NULL
,
`name`
varchar
(
32
)
NOT
NULL
default
''
)
ENGINE
=
"FEDERATED"
DEFAULT
CHARSET
=
latin1
COMMENT
=
'mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1%'
;
INSERT
INTO
federated
.
t1
(
id
,
name
)
VALUES
(
1
,
'foo'
);
INSERT
INTO
federated
.
t1
(
id
,
name
)
VALUES
(
2
,
'fee'
);
SELECT
*
FROM
federated
.
t1
;
DELETE
FROM
federated
.
t1
;
DROP
TABLE
IF
EXISTS
federated
.
t1
;
eval
CREATE
TABLE
federated
.
`t1%`
(
`id`
int
(
20
)
NOT
NULL
,
`name`
varchar
(
32
)
NOT
NULL
default
''
)
ENGINE
=
"FEDERATED"
DEFAULT
CHARSET
=
latin1
COMMENT
=
'mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1%'
;
INSERT
INTO
federated
.
`t1%`
(
id
,
name
)
VALUES
(
1
,
'foo'
);
INSERT
INTO
federated
.
`t1%`
(
id
,
name
)
VALUES
(
2
,
'fee'
);
SELECT
*
FROM
federated
.
`t1%`
;
DELETE
FROM
federated
.
`t1%`
;
DROP
TABLE
IF
EXISTS
federated
.
`t1%`
;
connection
slave
;
DROP
TABLE
IF
EXISTS
federated
.
`t1%`
;
# I wanted to use timestamp, but results will fail if so!!!
DROP
TABLE
IF
EXISTS
federated
.
t1
;
CREATE
TABLE
federated
.
t1
(
`id`
int
(
20
)
NOT
NULL
auto_increment
,
`name`
varchar
(
32
)
NOT
NULL
default
''
,
...
...
@@ -25,12 +154,8 @@ CREATE TABLE federated.t1 (
KEY
`other_key`
(
`other`
))
DEFAULT
CHARSET
=
latin1
;
connection
master
;
--
disable_warnings
DROP
DATABASE
IF
EXISTS
federated
;
--
enable_warnings
CREATE
DATABASE
federated
;
connection
master
;
--
replace_result
$SLAVE_MYPORT
SLAVE_PORT
eval
CREATE
TABLE
federated
.
t1
(
`id`
int
(
20
)
NOT
NULL
auto_increment
,
...
...
@@ -660,33 +785,36 @@ INSERT INTO federated.t1 VALUES (0x0001);
INSERT
INTO
federated
.
t1
VALUES
(
0x0100
);
SELECT
HEX
(
a
)
FROM
federated
.
t1
;
#
TODO
#
#
CREATE TABLE federated.t1
# (a char(20)) charset=cp1251
# ENGINE="FEDERATED" COMMENT="mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1";
#
# connection slave;
# # simple tests for cyrillic, given to me by
#
DROP TABLE IF EXISTS federated.t1;
#
--replace_result $SLAVE_MYPORT SLAVE_PORT
#
eval CREATE TABLE federated.t1
#
(a char(20)) charset=cp1251
#
ENGINE="FEDERATED" COMMENT="mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1";
#
#
#
connection slave;
# DROP TABLE IF EXISTS federated.t1;
# CREATE TABLE federated.t1 (a char(20)) charset=cp1251;
#
# connection master;
#
#
#
connection master;
# INSERT INTO federated.t1 values (_cp1251'--1');
# INSERT INTO federated.t1 values (_cp1251'--2');
# SELECT * FROM federated.t1;
# SET names cp1251;
# INSERT INTO federated.t1 values ('--3');
# INSERT INTO federated.t1 values ('-Ũ-4');
# SELECT * FROM federated.t1;
#
select
hex(a) from federated.t1;
#
select
hex(a) from federated.t1 ORDER BY a desc;
#
update
federated.t1 SET a='--1' WHERE a='--1';
#
SELECT
hex(a) from federated.t1;
#
SELECT
hex(a) from federated.t1 ORDER BY a desc;
#
UPDATE
federated.t1 SET a='--1' WHERE a='--1';
# SELECT * FROM federated.t1;
# DELETE FROM federated.t1 WHERE a='-Ũ-4';
# SELECT * FROM federated.t1;
# DELETE FROM federated.t1 WHERE a>'-';
# SELECT * FROM federated.t1;
# SET names default;
# DROP TABLE IF EXISTS federated.t1;
#
# DROP TABLE IF EXISTS federated.t1;
#
...
...
sql/ha_federated.cc
View file @
d0603db7
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment