mirror of
https://github.com/MariaDB/server.git
synced 2025-11-12 10:22:39 +03:00
Merge zim.(none):/home/brian/mysql/dep-5.1
into zim.(none):/home/brian/mysql/remove-bdb-5.1
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
#
|
||||
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_bdb.inc
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_debug.inc
|
||||
|
||||
@@ -12,7 +11,7 @@ drop table if exists t1, t2;
|
||||
--enable_warnings
|
||||
reset master;
|
||||
|
||||
create table t1 (a int) engine=bdb;
|
||||
create table t1 (a int) engine=innodb;
|
||||
create table t2 (a int) engine=innodb;
|
||||
begin;
|
||||
insert t1 values (5);
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
-- require r/have_bdb.require
|
||||
disable_query_log;
|
||||
show variables like "have_bdb";
|
||||
enable_query_log;
|
||||
@@ -80,7 +80,7 @@ basedir=.
|
||||
EXTRA_ARG="--language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/"
|
||||
fi
|
||||
|
||||
mysqld_boot=" $execdir/mysqld --no-defaults --bootstrap --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb --skip-ndbcluster --skip-bdb --tmpdir=. $EXTRA_ARG"
|
||||
mysqld_boot=" $execdir/mysqld --no-defaults --bootstrap --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb --skip-ndbcluster --tmpdir=. $EXTRA_ARG"
|
||||
echo "running $mysqld_boot"
|
||||
|
||||
if $scriptdir/mysql_create_system_tables test $mdata $hostname | $mysqld_boot
|
||||
|
||||
@@ -2122,7 +2122,6 @@ sub install_db ($$) {
|
||||
mtr_add_arg($args, "--datadir=%s", $data_dir);
|
||||
mtr_add_arg($args, "--skip-innodb");
|
||||
mtr_add_arg($args, "--skip-ndbcluster");
|
||||
mtr_add_arg($args, "--skip-bdb");
|
||||
mtr_add_arg($args, "--tmpdir=.");
|
||||
|
||||
if ( ! $opt_netware )
|
||||
@@ -2215,7 +2214,6 @@ basedir = $path_my_basedir
|
||||
server_id = $server_id
|
||||
skip-stack-trace
|
||||
skip-innodb
|
||||
skip-bdb
|
||||
skip-ndbcluster
|
||||
EOF
|
||||
;
|
||||
@@ -2629,7 +2627,6 @@ sub mysqld_arguments ($$$$$) {
|
||||
if ( $opt_valgrind_mysqld )
|
||||
{
|
||||
mtr_add_arg($args, "%s--skip-safemalloc", $prefix);
|
||||
mtr_add_arg($args, "%s--skip-bdb", $prefix);
|
||||
}
|
||||
|
||||
my $pidfile;
|
||||
|
||||
@@ -536,8 +536,8 @@ while test $# -gt 0; do
|
||||
--valgrind | --valgrind-all)
|
||||
find_valgrind;
|
||||
VALGRIND=$FIND_VALGRIND
|
||||
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc --skip-bdb"
|
||||
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc --skip-bdb"
|
||||
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc"
|
||||
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc"
|
||||
SLEEP_TIME_AFTER_RESTART=10
|
||||
SLEEP_TIME_FOR_DELETE=60
|
||||
USE_RUNNING_SERVER=0
|
||||
|
||||
@@ -6,26 +6,26 @@ Table Op Msg_type Msg_text
|
||||
test.t4 backup error Failed copying .frm file (errno: X)
|
||||
test.t4 backup status Operation failed
|
||||
Warnings:
|
||||
Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
|
||||
Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
Error 1 Can't create/write to file 'MYSQLTEST_VARDIR/bogus/t4.frm' (Errcode: X)
|
||||
backup table t4 to '../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t4 backup status OK
|
||||
Warnings:
|
||||
Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
|
||||
Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
backup table t4 to '../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t4 backup error Failed copying .frm file (errno: X)
|
||||
test.t4 backup status Operation failed
|
||||
Warnings:
|
||||
Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
|
||||
Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
Error 1 Can't create/write to file 'MYSQLTEST_VARDIR/tmp/t4.frm' (Errcode: X)
|
||||
drop table t4;
|
||||
restore table t4 from '../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t4 restore status OK
|
||||
Warnings:
|
||||
Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
|
||||
Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
select count(*) from t4;
|
||||
count(*)
|
||||
0
|
||||
@@ -35,19 +35,19 @@ backup table t1 to '../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 backup status OK
|
||||
Warnings:
|
||||
Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
|
||||
Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
drop table t1;
|
||||
restore table t1 from '../bogus';
|
||||
Table Op Msg_type Msg_text
|
||||
t1 restore error Failed copying .frm file
|
||||
Warnings:
|
||||
Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
|
||||
Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
Error 29 File 'MYSQLTEST_VARDIR/bogus/t1.frm' not found (Errcode: X)
|
||||
restore table t1 from '../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 restore status OK
|
||||
Warnings:
|
||||
Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
|
||||
Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
select n from t1;
|
||||
n
|
||||
23
|
||||
@@ -62,7 +62,7 @@ Table Op Msg_type Msg_text
|
||||
test.t2 backup status OK
|
||||
test.t3 backup status OK
|
||||
Warnings:
|
||||
Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
|
||||
Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
drop table t1,t2,t3;
|
||||
restore table t1,t2,t3 from '../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
@@ -70,7 +70,7 @@ test.t1 restore status OK
|
||||
test.t2 restore status OK
|
||||
test.t3 restore status OK
|
||||
Warnings:
|
||||
Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
|
||||
Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
select n from t1;
|
||||
n
|
||||
23
|
||||
@@ -91,7 +91,7 @@ restore table t1 from '../tmp';
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 restore status OK
|
||||
Warnings:
|
||||
Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
|
||||
Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
rename table t1 to t5;
|
||||
lock tables t5 write;
|
||||
backup table t5 to '../tmp';
|
||||
@@ -99,7 +99,7 @@ unlock tables;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t5 backup status OK
|
||||
Warnings:
|
||||
Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
|
||||
Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
|
||||
drop table t5;
|
||||
DROP TABLE IF EXISTS `t+1`;
|
||||
CREATE TABLE `t+1` (c1 INT);
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
drop table if exists t1;
|
||||
create table t1(objid BIGINT not null, tablename varchar(64), oid BIGINT not null, test BIGINT, PRIMARY KEY (objid), UNIQUE(tablename)) engine=BDB;
|
||||
insert into t1 values(1, 't1',4,9);
|
||||
insert into t1 values(2, 'metatable',1,9);
|
||||
insert into t1 values(3, 'metaindex',1,9 );
|
||||
select * from t1;
|
||||
objid tablename oid test
|
||||
1 t1 4 9
|
||||
2 metatable 1 9
|
||||
3 metaindex 1 9
|
||||
alter table t1 drop column test;
|
||||
@@ -1,6 +0,0 @@
|
||||
select * from t1;
|
||||
objid tablename oid
|
||||
1 t1 4
|
||||
2 metatable 1
|
||||
3 metaindex 1
|
||||
drop table t1;
|
||||
@@ -1,39 +0,0 @@
|
||||
drop table if exists t1;
|
||||
CREATE TABLE t1 (
|
||||
ChargeID int(10) unsigned NOT NULL auto_increment,
|
||||
ServiceID int(10) unsigned DEFAULT '0' NOT NULL,
|
||||
ChargeDate date DEFAULT '0000-00-00' NOT NULL,
|
||||
ChargeAmount decimal(20,2) DEFAULT '0.00' NOT NULL,
|
||||
FedTaxes decimal(20,2) DEFAULT '0.00' NOT NULL,
|
||||
ProvTaxes decimal(20,2) DEFAULT '0.00' NOT NULL,
|
||||
ChargeStatus enum('New','Auth','Unauth','Sale','Denied','Refund')
|
||||
DEFAULT 'New' NOT NULL,
|
||||
ChargeAuthorizationMessage text,
|
||||
ChargeComment text,
|
||||
ChargeTimeStamp varchar(20),
|
||||
PRIMARY KEY (ChargeID),
|
||||
KEY ServiceID (ServiceID),
|
||||
KEY ChargeDate (ChargeDate)
|
||||
) engine=BDB;
|
||||
BEGIN;
|
||||
INSERT INTO t1
|
||||
VALUES(NULL,1,'2001-03-01',1,1,1,'New',NULL,NULL,'now');
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
UPDATE t1 SET ChargeAuthorizationMessage = 'blablabla' WHERE
|
||||
ChargeID = 1;
|
||||
COMMIT;
|
||||
INSERT INTO t1
|
||||
VALUES(NULL,1,'2001-03-01',1,1,1,'New',NULL,NULL,'now');
|
||||
select * from t1;
|
||||
ChargeID ServiceID ChargeDate ChargeAmount FedTaxes ProvTaxes ChargeStatus ChargeAuthorizationMessage ChargeComment ChargeTimeStamp
|
||||
1 1 2001-03-01 1.00 1.00 1.00 New blablabla NULL now
|
||||
2 1 2001-03-01 1.00 1.00 1.00 New NULL NULL now
|
||||
drop table t1;
|
||||
create table t1 (a int) engine=bdb;
|
||||
set autocommit=0;
|
||||
insert into t1 values(1);
|
||||
analyze table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
drop table t1;
|
||||
@@ -1,31 +0,0 @@
|
||||
drop table if exists t1,t2;
|
||||
create table t1 (id integer, x integer) engine=BDB;
|
||||
create table t2 (id integer, x integer) engine=BDB;
|
||||
insert into t1 values(0, 0);
|
||||
insert into t2 values(0, 0);
|
||||
set autocommit=0;
|
||||
update t1 set x = 1 where id = 0;
|
||||
set autocommit=0;
|
||||
update t2 set x = 1 where id = 0;
|
||||
select x from t1 where id = 0;
|
||||
select x from t2 where id = 0;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
commit;
|
||||
x
|
||||
1
|
||||
commit;
|
||||
select * from t1;
|
||||
id x
|
||||
0 1
|
||||
select * from t2;
|
||||
id x
|
||||
0 1
|
||||
commit;
|
||||
select * from t1;
|
||||
id x
|
||||
0 1
|
||||
select * from t2;
|
||||
id x
|
||||
0 1
|
||||
commit;
|
||||
drop table t1,t2;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,99 +0,0 @@
|
||||
drop table if exists t1, t2, t3;
|
||||
flush status;
|
||||
set autocommit=0;
|
||||
create table t1 (a int not null) engine=bdb;
|
||||
insert into t1 values (1),(2),(3);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
drop table t1;
|
||||
set autocommit=1;
|
||||
create table t1 (a int not null) engine=bdb;
|
||||
begin;
|
||||
insert into t1 values (1),(2),(3);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
drop table t1;
|
||||
create table t1 (a int not null) engine=bdb;
|
||||
create table t2 (a int not null) engine=bdb;
|
||||
create table t3 (a int not null) engine=bdb;
|
||||
insert into t1 values (1),(2);
|
||||
insert into t2 values (1),(2);
|
||||
insert into t3 values (1),(2);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
select * from t2;
|
||||
a
|
||||
1
|
||||
2
|
||||
select * from t3;
|
||||
a
|
||||
1
|
||||
2
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 3
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 0
|
||||
begin;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
select * from t2;
|
||||
a
|
||||
1
|
||||
2
|
||||
select * from t3;
|
||||
a
|
||||
1
|
||||
2
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 3
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 0
|
||||
insert into t1 values (3);
|
||||
insert into t2 values (3);
|
||||
insert into t1 values (4);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
select * from t2;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
select * from t3;
|
||||
a
|
||||
1
|
||||
2
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 3
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 0
|
||||
commit;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 1
|
||||
drop table if exists t1, t2, t3;
|
||||
@@ -1,462 +0,0 @@
|
||||
SET storage_engine=bdb;
|
||||
DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
|
||||
CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT);
|
||||
CREATE TABLE gis_line (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g LINESTRING);
|
||||
CREATE TABLE gis_polygon (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POLYGON);
|
||||
CREATE TABLE gis_multi_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTIPOINT);
|
||||
CREATE TABLE gis_multi_line (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTILINESTRING);
|
||||
CREATE TABLE gis_multi_polygon (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTIPOLYGON);
|
||||
CREATE TABLE gis_geometrycollection (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g GEOMETRYCOLLECTION);
|
||||
CREATE TABLE gis_geometry (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g GEOMETRY);
|
||||
SHOW CREATE TABLE gis_point;
|
||||
Table Create Table
|
||||
gis_point CREATE TABLE `gis_point` (
|
||||
`fid` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`g` point DEFAULT NULL,
|
||||
PRIMARY KEY (`fid`)
|
||||
) ENGINE=BerkeleyDB DEFAULT CHARSET=latin1
|
||||
SHOW FIELDS FROM gis_point;
|
||||
Field Type Null Key Default Extra
|
||||
fid int(11) NO PRI NULL auto_increment
|
||||
g point YES NULL
|
||||
SHOW FIELDS FROM gis_line;
|
||||
Field Type Null Key Default Extra
|
||||
fid int(11) NO PRI NULL auto_increment
|
||||
g linestring YES NULL
|
||||
SHOW FIELDS FROM gis_polygon;
|
||||
Field Type Null Key Default Extra
|
||||
fid int(11) NO PRI NULL auto_increment
|
||||
g polygon YES NULL
|
||||
SHOW FIELDS FROM gis_multi_point;
|
||||
Field Type Null Key Default Extra
|
||||
fid int(11) NO PRI NULL auto_increment
|
||||
g multipoint YES NULL
|
||||
SHOW FIELDS FROM gis_multi_line;
|
||||
Field Type Null Key Default Extra
|
||||
fid int(11) NO PRI NULL auto_increment
|
||||
g multilinestring YES NULL
|
||||
SHOW FIELDS FROM gis_multi_polygon;
|
||||
Field Type Null Key Default Extra
|
||||
fid int(11) NO PRI NULL auto_increment
|
||||
g multipolygon YES NULL
|
||||
SHOW FIELDS FROM gis_geometrycollection;
|
||||
Field Type Null Key Default Extra
|
||||
fid int(11) NO PRI NULL auto_increment
|
||||
g geometrycollection YES NULL
|
||||
SHOW FIELDS FROM gis_geometry;
|
||||
Field Type Null Key Default Extra
|
||||
fid int(11) NO PRI NULL auto_increment
|
||||
g geometry YES NULL
|
||||
INSERT INTO gis_point VALUES
|
||||
(101, PointFromText('POINT(10 10)')),
|
||||
(102, PointFromText('POINT(20 10)')),
|
||||
(103, PointFromText('POINT(20 20)')),
|
||||
(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
|
||||
INSERT INTO gis_line VALUES
|
||||
(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
|
||||
(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
|
||||
(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
|
||||
INSERT INTO gis_polygon VALUES
|
||||
(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
|
||||
(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
|
||||
(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
|
||||
INSERT INTO gis_multi_point VALUES
|
||||
(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
|
||||
(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
|
||||
(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
|
||||
INSERT INTO gis_multi_line VALUES
|
||||
(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
|
||||
(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
|
||||
(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
|
||||
INSERT INTO gis_multi_polygon VALUES
|
||||
(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
|
||||
(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
|
||||
(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
|
||||
INSERT INTO gis_geometrycollection VALUES
|
||||
(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
|
||||
(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
|
||||
INSERT into gis_geometry SELECT * FROM gis_point;
|
||||
INSERT into gis_geometry SELECT * FROM gis_line;
|
||||
INSERT into gis_geometry SELECT * FROM gis_polygon;
|
||||
INSERT into gis_geometry SELECT * FROM gis_multi_point;
|
||||
INSERT into gis_geometry SELECT * FROM gis_multi_line;
|
||||
INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
|
||||
INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
|
||||
SELECT fid, AsText(g) FROM gis_point ORDER by fid;
|
||||
fid AsText(g)
|
||||
101 POINT(10 10)
|
||||
102 POINT(20 10)
|
||||
103 POINT(20 20)
|
||||
104 POINT(10 20)
|
||||
SELECT fid, AsText(g) FROM gis_line ORDER by fid;
|
||||
fid AsText(g)
|
||||
105 LINESTRING(0 0,0 10,10 0)
|
||||
106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
|
||||
107 LINESTRING(10 10,40 10)
|
||||
SELECT fid, AsText(g) FROM gis_polygon ORDER by fid;
|
||||
fid AsText(g)
|
||||
108 POLYGON((10 10,20 10,20 20,10 20,10 10))
|
||||
109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
|
||||
110 POLYGON((0 0,30 0,30 30,0 0))
|
||||
SELECT fid, AsText(g) FROM gis_multi_point ORDER by fid;
|
||||
fid AsText(g)
|
||||
111 MULTIPOINT(0 0,10 10,10 20,20 20)
|
||||
112 MULTIPOINT(1 1,11 11,11 21,21 21)
|
||||
113 MULTIPOINT(3 6,4 10)
|
||||
SELECT fid, AsText(g) FROM gis_multi_line ORDER by fid;
|
||||
fid AsText(g)
|
||||
114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
|
||||
115 MULTILINESTRING((10 48,10 21,10 0))
|
||||
116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
|
||||
SELECT fid, AsText(g) FROM gis_multi_polygon ORDER by fid;
|
||||
fid AsText(g)
|
||||
117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
|
||||
118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
|
||||
119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
|
||||
SELECT fid, AsText(g) FROM gis_geometrycollection ORDER by fid;
|
||||
fid AsText(g)
|
||||
120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
|
||||
121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
|
||||
SELECT fid, AsText(g) FROM gis_geometry ORDER by fid;
|
||||
fid AsText(g)
|
||||
101 POINT(10 10)
|
||||
102 POINT(20 10)
|
||||
103 POINT(20 20)
|
||||
104 POINT(10 20)
|
||||
105 LINESTRING(0 0,0 10,10 0)
|
||||
106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
|
||||
107 LINESTRING(10 10,40 10)
|
||||
108 POLYGON((10 10,20 10,20 20,10 20,10 10))
|
||||
109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
|
||||
110 POLYGON((0 0,30 0,30 30,0 0))
|
||||
111 MULTIPOINT(0 0,10 10,10 20,20 20)
|
||||
112 MULTIPOINT(1 1,11 11,11 21,21 21)
|
||||
113 MULTIPOINT(3 6,4 10)
|
||||
114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
|
||||
115 MULTILINESTRING((10 48,10 21,10 0))
|
||||
116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
|
||||
117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
|
||||
118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
|
||||
119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
|
||||
120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
|
||||
121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
|
||||
SELECT fid, Dimension(g) FROM gis_geometry ORDER by fid;
|
||||
fid Dimension(g)
|
||||
101 0
|
||||
102 0
|
||||
103 0
|
||||
104 0
|
||||
105 1
|
||||
106 1
|
||||
107 1
|
||||
108 2
|
||||
109 2
|
||||
110 2
|
||||
111 0
|
||||
112 0
|
||||
113 0
|
||||
114 1
|
||||
115 1
|
||||
116 1
|
||||
117 2
|
||||
118 2
|
||||
119 2
|
||||
120 1
|
||||
121 1
|
||||
SELECT fid, GeometryType(g) FROM gis_geometry ORDER by fid;
|
||||
fid GeometryType(g)
|
||||
101 POINT
|
||||
102 POINT
|
||||
103 POINT
|
||||
104 POINT
|
||||
105 LINESTRING
|
||||
106 LINESTRING
|
||||
107 LINESTRING
|
||||
108 POLYGON
|
||||
109 POLYGON
|
||||
110 POLYGON
|
||||
111 MULTIPOINT
|
||||
112 MULTIPOINT
|
||||
113 MULTIPOINT
|
||||
114 MULTILINESTRING
|
||||
115 MULTILINESTRING
|
||||
116 MULTILINESTRING
|
||||
117 MULTIPOLYGON
|
||||
118 MULTIPOLYGON
|
||||
119 MULTIPOLYGON
|
||||
120 GEOMETRYCOLLECTION
|
||||
121 GEOMETRYCOLLECTION
|
||||
SELECT fid, IsEmpty(g) FROM gis_geometry ORDER by fid;
|
||||
fid IsEmpty(g)
|
||||
101 0
|
||||
102 0
|
||||
103 0
|
||||
104 0
|
||||
105 0
|
||||
106 0
|
||||
107 0
|
||||
108 0
|
||||
109 0
|
||||
110 0
|
||||
111 0
|
||||
112 0
|
||||
113 0
|
||||
114 0
|
||||
115 0
|
||||
116 0
|
||||
117 0
|
||||
118 0
|
||||
119 0
|
||||
120 0
|
||||
121 0
|
||||
SELECT fid, AsText(Envelope(g)) FROM gis_geometry ORDER by fid;
|
||||
fid AsText(Envelope(g))
|
||||
101 POLYGON((10 10,10 10,10 10,10 10,10 10))
|
||||
102 POLYGON((20 10,20 10,20 10,20 10,20 10))
|
||||
103 POLYGON((20 20,20 20,20 20,20 20,20 20))
|
||||
104 POLYGON((10 20,10 20,10 20,10 20,10 20))
|
||||
105 POLYGON((0 0,10 0,10 10,0 10,0 0))
|
||||
106 POLYGON((10 10,20 10,20 20,10 20,10 10))
|
||||
107 POLYGON((10 10,40 10,40 10,10 10,10 10))
|
||||
108 POLYGON((10 10,20 10,20 20,10 20,10 10))
|
||||
109 POLYGON((0 0,50 0,50 50,0 50,0 0))
|
||||
110 POLYGON((0 0,30 0,30 30,0 30,0 0))
|
||||
111 POLYGON((0 0,20 0,20 20,0 20,0 0))
|
||||
112 POLYGON((1 1,21 1,21 21,1 21,1 1))
|
||||
113 POLYGON((3 6,4 6,4 10,3 10,3 6))
|
||||
114 POLYGON((10 0,16 0,16 48,10 48,10 0))
|
||||
115 POLYGON((10 0,10 0,10 48,10 48,10 0))
|
||||
116 POLYGON((1 2,21 2,21 8,1 8,1 2))
|
||||
117 POLYGON((28 0,84 0,84 42,28 42,28 0))
|
||||
118 POLYGON((28 0,84 0,84 42,28 42,28 0))
|
||||
119 POLYGON((0 0,3 0,3 3,0 3,0 0))
|
||||
120 POLYGON((0 0,10 0,10 10,0 10,0 0))
|
||||
121 POLYGON((3 6,44 6,44 9,3 9,3 6))
|
||||
explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21 100.00
|
||||
Warnings:
|
||||
Note 1003 select dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,astext(envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry`
|
||||
SELECT fid, X(g) FROM gis_point ORDER by fid;
|
||||
fid X(g)
|
||||
101 10
|
||||
102 20
|
||||
103 20
|
||||
104 10
|
||||
SELECT fid, Y(g) FROM gis_point ORDER by fid;
|
||||
fid Y(g)
|
||||
101 10
|
||||
102 10
|
||||
103 20
|
||||
104 20
|
||||
explain extended select X(g),Y(g) FROM gis_point;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE gis_point ALL NULL NULL NULL NULL 4 100.00
|
||||
Warnings:
|
||||
Note 1003 select x(`test`.`gis_point`.`g`) AS `X(g)`,y(`test`.`gis_point`.`g`) AS `Y(g)` from `test`.`gis_point`
|
||||
SELECT fid, AsText(StartPoint(g)) FROM gis_line ORDER by fid;
|
||||
fid AsText(StartPoint(g))
|
||||
105 POINT(0 0)
|
||||
106 POINT(10 10)
|
||||
107 POINT(10 10)
|
||||
SELECT fid, AsText(EndPoint(g)) FROM gis_line ORDER by fid;
|
||||
fid AsText(EndPoint(g))
|
||||
105 POINT(10 0)
|
||||
106 POINT(10 10)
|
||||
107 POINT(40 10)
|
||||
SELECT fid, GLength(g) FROM gis_line ORDER by fid;
|
||||
fid GLength(g)
|
||||
105 24.142135623731
|
||||
106 40
|
||||
107 30
|
||||
SELECT fid, NumPoints(g) FROM gis_line ORDER by fid;
|
||||
fid NumPoints(g)
|
||||
105 3
|
||||
106 5
|
||||
107 2
|
||||
SELECT fid, AsText(PointN(g, 2)) FROM gis_line ORDER by fid;
|
||||
fid AsText(PointN(g, 2))
|
||||
105 POINT(0 10)
|
||||
106 POINT(20 10)
|
||||
107 POINT(40 10)
|
||||
SELECT fid, IsClosed(g) FROM gis_line ORDER by fid;
|
||||
fid IsClosed(g)
|
||||
105 0
|
||||
106 1
|
||||
107 0
|
||||
explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE gis_line ALL NULL NULL NULL NULL 3 100.00
|
||||
Warnings:
|
||||
Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint(g))`,astext(endpoint(`test`.`gis_line`.`g`)) AS `AsText(EndPoint(g))`,glength(`test`.`gis_line`.`g`) AS `GLength(g)`,numpoints(`test`.`gis_line`.`g`) AS `NumPoints(g)`,astext(pointn(`test`.`gis_line`.`g`,2)) AS `AsText(PointN(g, 2))`,isclosed(`test`.`gis_line`.`g`) AS `IsClosed(g)` from `test`.`gis_line`
|
||||
SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
|
||||
fid AsText(Centroid(g))
|
||||
108 POINT(15 15)
|
||||
109 POINT(25.416666666667 25.416666666667)
|
||||
110 POINT(20 10)
|
||||
SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
|
||||
fid Area(g)
|
||||
108 100
|
||||
109 2400
|
||||
110 450
|
||||
SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon ORDER by fid;
|
||||
fid AsText(ExteriorRing(g))
|
||||
108 LINESTRING(10 10,20 10,20 20,10 20,10 10)
|
||||
109 LINESTRING(0 0,50 0,50 50,0 50,0 0)
|
||||
110 LINESTRING(0 0,30 0,30 30,0 0)
|
||||
SELECT fid, NumInteriorRings(g) FROM gis_polygon ORDER by fid;
|
||||
fid NumInteriorRings(g)
|
||||
108 0
|
||||
109 1
|
||||
110 0
|
||||
SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon ORDER by fid;
|
||||
fid AsText(InteriorRingN(g, 1))
|
||||
108 NULL
|
||||
109 LINESTRING(10 10,20 10,20 20,10 20,10 10)
|
||||
110 NULL
|
||||
explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3 100.00
|
||||
Warnings:
|
||||
Note 1003 select astext(centroid(`test`.`gis_polygon`.`g`)) AS `AsText(Centroid(g))`,area(`test`.`gis_polygon`.`g`) AS `Area(g)`,astext(exteriorring(`test`.`gis_polygon`.`g`)) AS `AsText(ExteriorRing(g))`,numinteriorrings(`test`.`gis_polygon`.`g`) AS `NumInteriorRings(g)`,astext(interiorringn(`test`.`gis_polygon`.`g`,1)) AS `AsText(InteriorRingN(g, 1))` from `test`.`gis_polygon`
|
||||
SELECT fid, IsClosed(g) FROM gis_multi_line ORDER by fid;
|
||||
fid IsClosed(g)
|
||||
114 0
|
||||
115 0
|
||||
116 0
|
||||
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
|
||||
fid AsText(Centroid(g))
|
||||
117 POINT(55.588527753042 17.426536064114)
|
||||
118 POINT(55.588527753042 17.426536064114)
|
||||
119 POINT(2 2)
|
||||
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
|
||||
fid Area(g)
|
||||
117 1684.5
|
||||
118 1684.5
|
||||
119 4.5
|
||||
SELECT fid, NumGeometries(g) from gis_multi_point ORDER by fid;
|
||||
fid NumGeometries(g)
|
||||
111 4
|
||||
112 4
|
||||
113 2
|
||||
SELECT fid, NumGeometries(g) from gis_multi_line ORDER by fid;
|
||||
fid NumGeometries(g)
|
||||
114 2
|
||||
115 1
|
||||
116 2
|
||||
SELECT fid, NumGeometries(g) from gis_multi_polygon ORDER by fid;
|
||||
fid NumGeometries(g)
|
||||
117 2
|
||||
118 2
|
||||
119 1
|
||||
SELECT fid, NumGeometries(g) from gis_geometrycollection ORDER by fid;
|
||||
fid NumGeometries(g)
|
||||
120 2
|
||||
121 2
|
||||
explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00
|
||||
Warnings:
|
||||
Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,numgeometries(`test`.`gis_multi_point`.`g`) AS `NumGeometries(g)` from `test`.`gis_multi_point`
|
||||
SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point ORDER by fid;
|
||||
fid AsText(GeometryN(g, 2))
|
||||
111 POINT(10 10)
|
||||
112 POINT(11 11)
|
||||
113 POINT(4 10)
|
||||
SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line ORDER by fid;
|
||||
fid AsText(GeometryN(g, 2))
|
||||
114 LINESTRING(16 0,16 23,16 48)
|
||||
115 NULL
|
||||
116 LINESTRING(2 5,5 8,21 7)
|
||||
SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon ORDER by fid;
|
||||
fid AsText(GeometryN(g, 2))
|
||||
117 POLYGON((59 18,67 18,67 13,59 13,59 18))
|
||||
118 POLYGON((59 18,67 18,67 13,59 13,59 18))
|
||||
119 NULL
|
||||
SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection ORDER by fid;
|
||||
fid AsText(GeometryN(g, 2))
|
||||
120 LINESTRING(0 0,10 10)
|
||||
121 LINESTRING(3 6,7 9)
|
||||
SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection ORDER by fid;
|
||||
fid AsText(GeometryN(g, 1))
|
||||
120 POINT(0 0)
|
||||
121 POINT(44 6)
|
||||
explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00
|
||||
Warnings:
|
||||
Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,astext(geometryn(`test`.`gis_multi_point`.`g`,2)) AS `AsText(GeometryN(g, 2))` from `test`.`gis_multi_point`
|
||||
SELECT g1.fid as first, g2.fid as second,
|
||||
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
|
||||
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
|
||||
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
|
||||
first second w c o e d t i r
|
||||
120 120 1 1 0 1 0 0 1 0
|
||||
120 121 0 0 0 0 0 0 1 0
|
||||
121 120 0 0 1 0 0 0 1 0
|
||||
121 121 1 1 0 1 0 0 1 0
|
||||
explain extended SELECT g1.fid as first, g2.fid as second,
|
||||
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
|
||||
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
|
||||
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
|
||||
1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00
|
||||
Warnings:
|
||||
Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
|
||||
DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
|
||||
CREATE TABLE t1 (
|
||||
a INTEGER PRIMARY KEY AUTO_INCREMENT,
|
||||
gp point,
|
||||
ln linestring,
|
||||
pg polygon,
|
||||
mp multipoint,
|
||||
mln multilinestring,
|
||||
mpg multipolygon,
|
||||
gc geometrycollection,
|
||||
gm geometry
|
||||
);
|
||||
SHOW FIELDS FROM t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO PRI NULL auto_increment
|
||||
gp point YES NULL
|
||||
ln linestring YES NULL
|
||||
pg polygon YES NULL
|
||||
mp multipoint YES NULL
|
||||
mln multilinestring YES NULL
|
||||
mpg multipolygon YES NULL
|
||||
gc geometrycollection YES NULL
|
||||
gm geometry YES NULL
|
||||
ALTER TABLE t1 ADD fid INT;
|
||||
SHOW FIELDS FROM t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO PRI NULL auto_increment
|
||||
gp point YES NULL
|
||||
ln linestring YES NULL
|
||||
pg polygon YES NULL
|
||||
mp multipoint YES NULL
|
||||
mln multilinestring YES NULL
|
||||
mpg multipolygon YES NULL
|
||||
gc geometrycollection YES NULL
|
||||
gm geometry YES NULL
|
||||
fid int(11) YES NULL
|
||||
DROP TABLE t1;
|
||||
create table t1 (pk integer primary key auto_increment, a geometry not null);
|
||||
insert into t1 (a) values (GeomFromText('Point(1 2)'));
|
||||
insert into t1 (a) values ('Garbage');
|
||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||
insert IGNORE into t1 (a) values ('Garbage');
|
||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||
drop table t1;
|
||||
create table t1 (pk integer primary key auto_increment, fl geometry);
|
||||
insert into t1 (fl) values (1);
|
||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||
insert into t1 (fl) values (1.11);
|
||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||
insert into t1 (fl) values ("qwerty");
|
||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||
insert into t1 (fl) values (pointfromtext('point(1,1)'));
|
||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||
drop table t1;
|
||||
@@ -1,6 +1,6 @@
|
||||
drop table if exists t1, t2;
|
||||
reset master;
|
||||
create table t1 (a int) engine=bdb;
|
||||
create table t1 (a int) engine=innodb;
|
||||
create table t2 (a int) engine=innodb;
|
||||
begin;
|
||||
insert t1 values (5);
|
||||
@@ -10,12 +10,12 @@ insert t2 values (5);
|
||||
commit;
|
||||
show binlog events from 102;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=bdb
|
||||
master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=innodb
|
||||
master-bin.000001 # Query 1 # use `test`; create table t2 (a int) engine=innodb
|
||||
master-bin.000001 # Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query 1 # use `test`; COMMIT
|
||||
master-bin.000001 # Xid 1 # COMMIT /* xid= */
|
||||
master-bin.000001 # Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map 1 # table_id: # (test.t2)
|
||||
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
|
||||
|
||||
@@ -12,7 +12,7 @@ master-bin.000001 367 Xid 1 394 COMMIT /* XID */
|
||||
drop table t1;
|
||||
drop table if exists t1, t2;
|
||||
reset master;
|
||||
create table t1 (a int) engine=bdb;
|
||||
create table t1 (a int) engine=innodb;
|
||||
create table t2 (a int) engine=innodb;
|
||||
begin;
|
||||
insert t1 values (5);
|
||||
@@ -22,11 +22,11 @@ insert t2 values (5);
|
||||
commit;
|
||||
show binlog events from 102;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=bdb
|
||||
master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=innodb
|
||||
master-bin.000001 # Query 1 # use `test`; create table t2 (a int) engine=innodb
|
||||
master-bin.000001 # Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test`; insert t1 values (5)
|
||||
master-bin.000001 # Query 1 # use `test`; COMMIT
|
||||
master-bin.000001 # Xid 1 # COMMIT /* xid= */
|
||||
master-bin.000001 # Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test`; insert t2 values (5)
|
||||
master-bin.000001 # Xid 1 # COMMIT /* xid= */
|
||||
|
||||
@@ -479,7 +479,7 @@ drop table t1;
|
||||
create table t1 (
|
||||
c char(10) character set utf8,
|
||||
unique key a (c(1))
|
||||
) engine=bdb;
|
||||
) engine=innodb;
|
||||
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
||||
insert into t1 values ('aa');
|
||||
ERROR 23000: Duplicate entry 'aa' for key 'a'
|
||||
@@ -637,7 +637,7 @@ drop table t1;
|
||||
create table t1 (
|
||||
c char(10) character set utf8 collate utf8_bin,
|
||||
unique key a (c(1))
|
||||
) engine=bdb;
|
||||
) engine=innodb;
|
||||
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
||||
insert into t1 values ('aa');
|
||||
ERROR 23000: Duplicate entry 'aa' for key 'a'
|
||||
@@ -707,7 +707,7 @@ drop table t1;
|
||||
create table t1 (
|
||||
str varchar(255) character set utf8 not null,
|
||||
key str (str(2))
|
||||
) engine=bdb;
|
||||
) engine=innodb;
|
||||
INSERT INTO t1 VALUES ('str');
|
||||
INSERT INTO t1 VALUES ('str2');
|
||||
select * from t1 where str='str';
|
||||
@@ -796,7 +796,7 @@ insert into t1 values(1,'foo'),(2,'foobar');
|
||||
select * from t1 where b like 'foob%';
|
||||
a b
|
||||
2 foobar
|
||||
alter table t1 engine=bdb;
|
||||
alter table t1 engine=innodb;
|
||||
select * from t1 where b like 'foob%';
|
||||
a b
|
||||
2 foobar
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Variable_name Value
|
||||
have_bdb YES
|
||||
@@ -43,7 +43,6 @@ character-sets-dir option_value
|
||||
basedir option_value
|
||||
skip-stack-trace option_value
|
||||
skip-innodb option_value
|
||||
skip-bdb option_value
|
||||
skip-ndbcluster option_value
|
||||
nonguarded option_value
|
||||
log-output option_value
|
||||
@@ -64,7 +63,6 @@ character-sets-dir option_value
|
||||
basedir option_value
|
||||
skip-stack-trace option_value
|
||||
skip-innodb option_value
|
||||
skip-bdb option_value
|
||||
skip-ndbcluster option_value
|
||||
nonguarded option_value
|
||||
log-output option_value
|
||||
|
||||
@@ -22,7 +22,6 @@ basedir VALUE
|
||||
server_id VALUE
|
||||
skip-stack-trace VALUE
|
||||
skip-innodb VALUE
|
||||
skip-bdb VALUE
|
||||
skip-ndbcluster VALUE
|
||||
log-output VALUE
|
||||
SHOW INSTANCE OPTIONS mysqld2;
|
||||
@@ -41,7 +40,6 @@ basedir VALUE
|
||||
server_id VALUE
|
||||
skip-stack-trace VALUE
|
||||
skip-innodb VALUE
|
||||
skip-bdb VALUE
|
||||
skip-ndbcluster VALUE
|
||||
nonguarded VALUE
|
||||
log-output VALUE
|
||||
|
||||
@@ -1,136 +0,0 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (
|
||||
pk int primary key,
|
||||
key1 int,
|
||||
key2 int,
|
||||
filler char(200),
|
||||
filler2 char(200),
|
||||
index(key1),
|
||||
index(key2)
|
||||
) engine=bdb;
|
||||
select * from t1 where (key1 >= 2 and key1 <= 10) or (pk >= 4 and pk <=8 );
|
||||
pk key1 key2 filler filler2
|
||||
2 2 2 filler-data filler-data-2
|
||||
3 3 3 filler-data filler-data-2
|
||||
9 9 9 filler-data filler-data-2
|
||||
10 10 10 filler-data filler-data-2
|
||||
4 4 4 filler-data filler-data-2
|
||||
5 5 5 filler-data filler-data-2
|
||||
6 6 6 filler-data filler-data-2
|
||||
7 7 7 filler-data filler-data-2
|
||||
8 8 8 filler-data filler-data-2
|
||||
set @maxv=1000;
|
||||
select * from t1 where
|
||||
(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
|
||||
or key1=18 or key1=60;
|
||||
pk key1 key2 filler filler2
|
||||
18 18 18 filler-data filler-data-2
|
||||
60 60 60 filler-data filler-data-2
|
||||
1 1 1 filler-data filler-data-2
|
||||
2 2 2 filler-data filler-data-2
|
||||
3 3 3 filler-data filler-data-2
|
||||
4 4 4 filler-data filler-data-2
|
||||
11 11 11 filler-data filler-data-2
|
||||
12 12 12 filler-data filler-data-2
|
||||
13 13 13 filler-data filler-data-2
|
||||
14 14 14 filler-data filler-data-2
|
||||
50 50 50 filler-data filler-data-2
|
||||
51 51 51 filler-data filler-data-2
|
||||
52 52 52 filler-data filler-data-2
|
||||
53 53 53 filler-data filler-data-2
|
||||
54 54 54 filler-data filler-data-2
|
||||
991 991 991 filler-data filler-data-2
|
||||
992 992 992 filler-data filler-data-2
|
||||
993 993 993 filler-data filler-data-2
|
||||
994 994 994 filler-data filler-data-2
|
||||
995 995 995 filler-data filler-data-2
|
||||
996 996 996 filler-data filler-data-2
|
||||
997 997 997 filler-data filler-data-2
|
||||
998 998 998 filler-data filler-data-2
|
||||
999 999 999 filler-data filler-data-2
|
||||
1000 1000 1000 filler-data filler-data-2
|
||||
select * from t1 where
|
||||
(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
|
||||
or key1 < 3 or key1 > @maxv-11;
|
||||
pk key1 key2 filler filler2
|
||||
990 990 990 filler-data filler-data-2
|
||||
1 1 1 filler-data filler-data-2
|
||||
2 2 2 filler-data filler-data-2
|
||||
3 3 3 filler-data filler-data-2
|
||||
4 4 4 filler-data filler-data-2
|
||||
11 11 11 filler-data filler-data-2
|
||||
12 12 12 filler-data filler-data-2
|
||||
13 13 13 filler-data filler-data-2
|
||||
14 14 14 filler-data filler-data-2
|
||||
50 50 50 filler-data filler-data-2
|
||||
51 51 51 filler-data filler-data-2
|
||||
52 52 52 filler-data filler-data-2
|
||||
53 53 53 filler-data filler-data-2
|
||||
54 54 54 filler-data filler-data-2
|
||||
991 991 991 filler-data filler-data-2
|
||||
992 992 992 filler-data filler-data-2
|
||||
993 993 993 filler-data filler-data-2
|
||||
994 994 994 filler-data filler-data-2
|
||||
995 995 995 filler-data filler-data-2
|
||||
996 996 996 filler-data filler-data-2
|
||||
997 997 997 filler-data filler-data-2
|
||||
998 998 998 filler-data filler-data-2
|
||||
999 999 999 filler-data filler-data-2
|
||||
1000 1000 1000 filler-data filler-data-2
|
||||
select * from t1 where
|
||||
(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
|
||||
or
|
||||
(key1 < 5) or (key1 > 10 and key1 < 15) or (key1 >= 50 and key1 < 55 ) or (key1 > @maxv-10);
|
||||
pk key1 key2 filler filler2
|
||||
1 1 1 filler-data filler-data-2
|
||||
2 2 2 filler-data filler-data-2
|
||||
3 3 3 filler-data filler-data-2
|
||||
4 4 4 filler-data filler-data-2
|
||||
11 11 11 filler-data filler-data-2
|
||||
12 12 12 filler-data filler-data-2
|
||||
13 13 13 filler-data filler-data-2
|
||||
14 14 14 filler-data filler-data-2
|
||||
50 50 50 filler-data filler-data-2
|
||||
51 51 51 filler-data filler-data-2
|
||||
52 52 52 filler-data filler-data-2
|
||||
53 53 53 filler-data filler-data-2
|
||||
54 54 54 filler-data filler-data-2
|
||||
991 991 991 filler-data filler-data-2
|
||||
992 992 992 filler-data filler-data-2
|
||||
993 993 993 filler-data filler-data-2
|
||||
994 994 994 filler-data filler-data-2
|
||||
995 995 995 filler-data filler-data-2
|
||||
996 996 996 filler-data filler-data-2
|
||||
997 997 997 filler-data filler-data-2
|
||||
998 998 998 filler-data filler-data-2
|
||||
999 999 999 filler-data filler-data-2
|
||||
1000 1000 1000 filler-data filler-data-2
|
||||
select * from t1 where
|
||||
(pk > 10 and pk < 15) or (pk >= 50 and pk < 55 )
|
||||
or
|
||||
(key1 < 5) or (key1 > @maxv-10);
|
||||
pk key1 key2 filler filler2
|
||||
1 1 1 filler-data filler-data-2
|
||||
2 2 2 filler-data filler-data-2
|
||||
3 3 3 filler-data filler-data-2
|
||||
4 4 4 filler-data filler-data-2
|
||||
991 991 991 filler-data filler-data-2
|
||||
992 992 992 filler-data filler-data-2
|
||||
993 993 993 filler-data filler-data-2
|
||||
994 994 994 filler-data filler-data-2
|
||||
995 995 995 filler-data filler-data-2
|
||||
996 996 996 filler-data filler-data-2
|
||||
997 997 997 filler-data filler-data-2
|
||||
998 998 998 filler-data filler-data-2
|
||||
999 999 999 filler-data filler-data-2
|
||||
1000 1000 1000 filler-data filler-data-2
|
||||
11 11 11 filler-data filler-data-2
|
||||
12 12 12 filler-data filler-data-2
|
||||
13 13 13 filler-data filler-data-2
|
||||
14 14 14 filler-data filler-data-2
|
||||
50 50 50 filler-data filler-data-2
|
||||
51 51 51 filler-data filler-data-2
|
||||
52 52 52 filler-data filler-data-2
|
||||
53 53 53 filler-data filler-data-2
|
||||
54 54 54 filler-data filler-data-2
|
||||
drop table t1;
|
||||
@@ -29,13 +29,13 @@ on (mysql.general_log.command_type = join_test.command_type)
|
||||
drop table join_test;
|
||||
flush logs;
|
||||
lock tables mysql.general_log WRITE;
|
||||
ERROR HY000: You can't write-lock a log table. Only read access is possible.
|
||||
ERROR HY000: You can't write-lock a log table. Only read access is possible
|
||||
lock tables mysql.slow_log WRITE;
|
||||
ERROR HY000: You can't write-lock a log table. Only read access is possible.
|
||||
ERROR HY000: You can't write-lock a log table. Only read access is possible
|
||||
lock tables mysql.general_log READ;
|
||||
ERROR HY000: You can't use usual read lock with log tables. Try READ LOCAL instead.
|
||||
ERROR HY000: You can't use usual read lock with log tables. Try READ LOCAL instead
|
||||
lock tables mysql.slow_log READ;
|
||||
ERROR HY000: You can't use usual read lock with log tables. Try READ LOCAL instead.
|
||||
ERROR HY000: You can't use usual read lock with log tables. Try READ LOCAL instead
|
||||
lock tables mysql.slow_log READ LOCAL, mysql.general_log READ LOCAL;
|
||||
unlock tables;
|
||||
lock tables mysql.general_log READ LOCAL;
|
||||
@@ -161,13 +161,13 @@ TIMESTAMP USER_HOST THREAD_ID 1 Query set global slow_query_log='ON'
|
||||
TIMESTAMP USER_HOST THREAD_ID 1 Query select * from mysql.general_log
|
||||
flush logs;
|
||||
lock tables mysql.general_log WRITE;
|
||||
ERROR HY000: You can't write-lock a log table. Only read access is possible.
|
||||
ERROR HY000: You can't write-lock a log table. Only read access is possible
|
||||
lock tables mysql.slow_log WRITE;
|
||||
ERROR HY000: You can't write-lock a log table. Only read access is possible.
|
||||
ERROR HY000: You can't write-lock a log table. Only read access is possible
|
||||
lock tables mysql.general_log READ;
|
||||
ERROR HY000: You can't use usual read lock with log tables. Try READ LOCAL instead.
|
||||
ERROR HY000: You can't use usual read lock with log tables. Try READ LOCAL instead
|
||||
lock tables mysql.slow_log READ;
|
||||
ERROR HY000: You can't use usual read lock with log tables. Try READ LOCAL instead.
|
||||
ERROR HY000: You can't use usual read lock with log tables. Try READ LOCAL instead
|
||||
lock tables mysql.slow_log READ LOCAL, mysql.general_log READ LOCAL;
|
||||
unlock tables;
|
||||
set global general_log='OFF';
|
||||
|
||||
@@ -492,7 +492,7 @@ create table t2 like t1;
|
||||
insert into t2 select * from t1;
|
||||
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
|
||||
drop table t1,t2;
|
||||
create table t1 ( c char(8) not null ) engine=bdb;
|
||||
create table t1 ( c char(8) not null ) engine=innodb;
|
||||
insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
|
||||
insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
|
||||
alter table t1 add b char(8) not null;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,186 +0,0 @@
|
||||
drop table if exists t1, t2, t3,t4;
|
||||
create table t1 (
|
||||
pk1 int not NULL,
|
||||
key1 int(11),
|
||||
key2 int(11),
|
||||
PRIMARY KEY (pk1),
|
||||
KEY key1 (key1),
|
||||
KEY key2 (key2)
|
||||
) engine=bdb;
|
||||
insert into t1 values (-5, 1, 1),
|
||||
(-100, 1, 1),
|
||||
(3, 1, 1),
|
||||
(0, 1, 1),
|
||||
(10, 1, 1);
|
||||
explain select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL 5 Using sort_union(key1,key2); Using where
|
||||
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
|
||||
pk1 key1 key2
|
||||
-100 1 1
|
||||
-5 1 1
|
||||
0 1 1
|
||||
3 1 1
|
||||
10 1 1
|
||||
drop table t1;
|
||||
create table t1 (
|
||||
pk1 int unsigned not NULL,
|
||||
key1 int(11),
|
||||
key2 int(11),
|
||||
PRIMARY KEY (pk1),
|
||||
KEY key1 (key1),
|
||||
KEY key2 (key2)
|
||||
) engine=bdb;
|
||||
insert into t1 values (0, 1, 1),
|
||||
(0xFFFFFFFF, 1, 1),
|
||||
(0xFFFFFFFE, 1, 1),
|
||||
(1, 1, 1),
|
||||
(2, 1, 1);
|
||||
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
|
||||
pk1 key1 key2
|
||||
0 1 1
|
||||
1 1 1
|
||||
2 1 1
|
||||
4294967294 1 1
|
||||
4294967295 1 1
|
||||
drop table t1;
|
||||
create table t1 (
|
||||
pk1 char(4) not NULL,
|
||||
key1 int(11),
|
||||
key2 int(11),
|
||||
PRIMARY KEY (pk1),
|
||||
KEY key1 (key1),
|
||||
KEY key2 (key2)
|
||||
) engine=bdb collate latin2_general_ci;
|
||||
insert into t1 values ('a1', 1, 1),
|
||||
('b2', 1, 1),
|
||||
('A3', 1, 1),
|
||||
('B4', 1, 1);
|
||||
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
|
||||
pk1 key1 key2
|
||||
a1 1 1
|
||||
A3 1 1
|
||||
b2 1 1
|
||||
B4 1 1
|
||||
drop table t1;
|
||||
create table t1 (
|
||||
pk1 int not NULL,
|
||||
pk2 char(4) not NULL collate latin1_german1_ci,
|
||||
pk3 char(4) not NULL collate latin1_bin,
|
||||
key1 int(11),
|
||||
key2 int(11),
|
||||
PRIMARY KEY (pk1,pk2,pk3),
|
||||
KEY key1 (key1),
|
||||
KEY key2 (key2)
|
||||
) engine=bdb;
|
||||
insert into t1 values
|
||||
(1, 'u', 'u', 1, 1),
|
||||
(1, 'u', char(0xEC), 1, 1),
|
||||
(1, 'u', 'x', 1, 1);
|
||||
insert ignore into t1 select pk1, char(0xEC), pk3, key1, key2 from t1;
|
||||
insert ignore into t1 select pk1, 'x', pk3, key1, key2 from t1 where pk2='u';
|
||||
insert ignore into t1 select 2, pk2, pk3, key1, key2 from t1;
|
||||
select * from t1;
|
||||
pk1 pk2 pk3 key1 key2
|
||||
1 <09> u 1 1
|
||||
1 <09> x 1 1
|
||||
1 <09> <09> 1 1
|
||||
1 u u 1 1
|
||||
1 u x 1 1
|
||||
1 u <09> 1 1
|
||||
1 x u 1 1
|
||||
1 x x 1 1
|
||||
1 x <09> 1 1
|
||||
2 <09> u 1 1
|
||||
2 <09> x 1 1
|
||||
2 <09> <09> 1 1
|
||||
2 u u 1 1
|
||||
2 u x 1 1
|
||||
2 u <09> 1 1
|
||||
2 x u 1 1
|
||||
2 x x 1 1
|
||||
2 x <09> 1 1
|
||||
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
|
||||
pk1 pk2 pk3 key1 key2
|
||||
1 <09> u 1 1
|
||||
1 <09> x 1 1
|
||||
1 <09> <09> 1 1
|
||||
1 u u 1 1
|
||||
1 u x 1 1
|
||||
1 u <09> 1 1
|
||||
1 x u 1 1
|
||||
1 x x 1 1
|
||||
1 x <09> 1 1
|
||||
2 <09> u 1 1
|
||||
2 <09> x 1 1
|
||||
2 <09> <09> 1 1
|
||||
2 u u 1 1
|
||||
2 u x 1 1
|
||||
2 u <09> 1 1
|
||||
2 x u 1 1
|
||||
2 x x 1 1
|
||||
2 x <09> 1 1
|
||||
alter table t1 drop primary key;
|
||||
select * from t1;
|
||||
pk1 pk2 pk3 key1 key2
|
||||
1 <09> u 1 1
|
||||
1 <09> x 1 1
|
||||
1 <09> <09> 1 1
|
||||
1 u u 1 1
|
||||
1 u x 1 1
|
||||
1 u <09> 1 1
|
||||
1 x u 1 1
|
||||
1 x x 1 1
|
||||
1 x <09> 1 1
|
||||
2 <09> u 1 1
|
||||
2 <09> x 1 1
|
||||
2 <09> <09> 1 1
|
||||
2 u u 1 1
|
||||
2 u x 1 1
|
||||
2 u <09> 1 1
|
||||
2 x u 1 1
|
||||
2 x x 1 1
|
||||
2 x <09> 1 1
|
||||
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
|
||||
pk1 pk2 pk3 key1 key2
|
||||
1 <09> u 1 1
|
||||
1 <09> x 1 1
|
||||
1 <09> <09> 1 1
|
||||
1 u u 1 1
|
||||
1 u x 1 1
|
||||
1 u <09> 1 1
|
||||
1 x u 1 1
|
||||
1 x x 1 1
|
||||
1 x <09> 1 1
|
||||
2 <09> u 1 1
|
||||
2 <09> x 1 1
|
||||
2 <09> <09> 1 1
|
||||
2 u u 1 1
|
||||
2 u x 1 1
|
||||
2 u <09> 1 1
|
||||
2 x u 1 1
|
||||
2 x x 1 1
|
||||
2 x <09> 1 1
|
||||
drop table t1;
|
||||
create table t1 (
|
||||
pk1 varchar(8) NOT NULL default '',
|
||||
pk2 varchar(4) NOT NULL default '',
|
||||
key1 int(11),
|
||||
key2 int(11),
|
||||
primary key(pk1, pk2),
|
||||
KEY key1 (key1),
|
||||
KEY key2 (key2)
|
||||
) engine=bdb;
|
||||
insert into t1 values ('','empt',2,2),
|
||||
('a','a--a',2,2),
|
||||
('bb','b--b',2,2),
|
||||
('ccc','c--c',2,2),
|
||||
('dddd','d--d',2,2);
|
||||
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
|
||||
pk1 pk2 key1 key2
|
||||
empt 2 2
|
||||
a a--a 2 2
|
||||
bb b--b 2 2
|
||||
ccc c--c 2 2
|
||||
dddd d--d 2 2
|
||||
drop table t1;
|
||||
@@ -692,7 +692,7 @@ drop database mysqltest;
|
||||
show full plugin;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning 1541 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW PLUGINS' instead.
|
||||
Warning 1541 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW PLUGINS' instead
|
||||
show plugin;
|
||||
show plugins;
|
||||
End of 5.1 tests
|
||||
|
||||
@@ -535,7 +535,7 @@ use db_bug7787|
|
||||
CREATE PROCEDURE p1()
|
||||
SHOW INNODB STATUS; |
|
||||
Warnings:
|
||||
Warning 1541 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW ENGINE INNODB STATUS' instead.
|
||||
Warning 1541 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW ENGINE INNODB STATUS' instead
|
||||
GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost|
|
||||
DROP DATABASE db_bug7787|
|
||||
drop user user_bug7787@localhost|
|
||||
|
||||
@@ -101,13 +101,13 @@ create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6),
|
||||
t8 timestamp(8), t10 timestamp(10), t12 timestamp(12),
|
||||
t14 timestamp(14));
|
||||
Warnings:
|
||||
Warning 1541 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead.
|
||||
Warning 1541 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead.
|
||||
Warning 1541 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead.
|
||||
Warning 1541 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead.
|
||||
Warning 1541 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead.
|
||||
Warning 1541 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead.
|
||||
Warning 1541 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead.
|
||||
Warning 1541 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
|
||||
Warning 1541 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
|
||||
Warning 1541 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
|
||||
Warning 1541 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
|
||||
Warning 1541 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
|
||||
Warning 1541 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
|
||||
Warning 1541 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
|
||||
insert t1 values (0,0,0,0,0,0,0),
|
||||
("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
|
||||
"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
|
||||
|
||||
@@ -175,7 +175,7 @@ Warning 1266 Using storage engine MyISAM for table 't1'
|
||||
drop table t1;
|
||||
set table_type=MYISAM;
|
||||
Warnings:
|
||||
Warning 1541 The syntax 'table_type' is deprecated and will be removed in MySQL 5.2. Please use 'storage_engine' instead.
|
||||
Warning 1541 The syntax 'table_type' is deprecated and will be removed in MySQL 5.2. Please use 'storage_engine' instead
|
||||
create table t1 (a int);
|
||||
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
update t1 set a='abc';
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#
|
||||
# Test of problem when shutting down mysqld at once after ALTER TABLE
|
||||
#
|
||||
-- source include/have_bdb.inc
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
create table t1(objid BIGINT not null, tablename varchar(64), oid BIGINT not null, test BIGINT, PRIMARY KEY (objid), UNIQUE(tablename)) engine=BDB;
|
||||
insert into t1 values(1, 't1',4,9);
|
||||
insert into t1 values(2, 'metatable',1,9);
|
||||
insert into t1 values(3, 'metaindex',1,9 );
|
||||
select * from t1;
|
||||
alter table t1 drop column test;
|
||||
|
||||
# Now we do a reboot and continue with the next test
|
||||
|
||||
# End of 4.1 tests
|
||||
@@ -1,2 +0,0 @@
|
||||
--skip-external-locking
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#
|
||||
# Note that this test uses tables from the previous test
|
||||
# This is to test that the table t1 survives a reboot of MySQL
|
||||
# The options in the -master.opt file are just there to force the reboot
|
||||
#
|
||||
-- source include/have_bdb.inc
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
@@ -1,51 +0,0 @@
|
||||
-- source include/have_bdb.inc
|
||||
|
||||
# test for bug reported by Mark Steele
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
CREATE TABLE t1 (
|
||||
ChargeID int(10) unsigned NOT NULL auto_increment,
|
||||
ServiceID int(10) unsigned DEFAULT '0' NOT NULL,
|
||||
ChargeDate date DEFAULT '0000-00-00' NOT NULL,
|
||||
ChargeAmount decimal(20,2) DEFAULT '0.00' NOT NULL,
|
||||
FedTaxes decimal(20,2) DEFAULT '0.00' NOT NULL,
|
||||
ProvTaxes decimal(20,2) DEFAULT '0.00' NOT NULL,
|
||||
ChargeStatus enum('New','Auth','Unauth','Sale','Denied','Refund')
|
||||
DEFAULT 'New' NOT NULL,
|
||||
ChargeAuthorizationMessage text,
|
||||
ChargeComment text,
|
||||
ChargeTimeStamp varchar(20),
|
||||
PRIMARY KEY (ChargeID),
|
||||
KEY ServiceID (ServiceID),
|
||||
KEY ChargeDate (ChargeDate)
|
||||
) engine=BDB;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO t1
|
||||
VALUES(NULL,1,'2001-03-01',1,1,1,'New',NULL,NULL,'now');
|
||||
COMMIT;
|
||||
|
||||
BEGIN;
|
||||
UPDATE t1 SET ChargeAuthorizationMessage = 'blablabla' WHERE
|
||||
ChargeID = 1;
|
||||
COMMIT;
|
||||
|
||||
INSERT INTO t1
|
||||
VALUES(NULL,1,'2001-03-01',1,1,1,'New',NULL,NULL,'now');
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test for bug #2342 "Running ANALYZE TABLE on bdb table
|
||||
# inside a transaction hangs server thread"
|
||||
|
||||
create table t1 (a int) engine=bdb;
|
||||
|
||||
set autocommit=0;
|
||||
insert into t1 values(1);
|
||||
analyze table t1;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
@@ -1,59 +0,0 @@
|
||||
# This test doesn't work with the embedded version as this code
|
||||
# assumes that one query is running while we are doing queries on
|
||||
# a second connection.
|
||||
# This would work if mysqltest run would be threaded and handle each
|
||||
# connection in a separate thread.
|
||||
#
|
||||
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_bdb.inc
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
connect (con2,localhost,root,,);
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
connection con1;
|
||||
create table t1 (id integer, x integer) engine=BDB;
|
||||
create table t2 (id integer, x integer) engine=BDB;
|
||||
insert into t1 values(0, 0);
|
||||
insert into t2 values(0, 0);
|
||||
set autocommit=0;
|
||||
update t1 set x = 1 where id = 0;
|
||||
|
||||
connection con2;
|
||||
set autocommit=0;
|
||||
update t2 set x = 1 where id = 0;
|
||||
|
||||
# The following query should hang because con1 is locking the page
|
||||
--send
|
||||
select x from t1 where id = 0;
|
||||
|
||||
connection con1;
|
||||
# This should generate a deadlock as we are trying to access a locked row
|
||||
--send
|
||||
select x from t2 where id = 0;
|
||||
|
||||
connection con2;
|
||||
--error 1213
|
||||
reap;
|
||||
commit;
|
||||
|
||||
connection con1;
|
||||
reap;
|
||||
commit;
|
||||
|
||||
connection con2;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
commit;
|
||||
|
||||
connection con1;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
commit;
|
||||
|
||||
drop table t1,t2;
|
||||
|
||||
# End of 4.1 tests
|
||||
@@ -1,59 +0,0 @@
|
||||
# This test doesn't work with the embedded version as this code
|
||||
# assumes that one query is running while we are doing queries on
|
||||
# a second connection.
|
||||
# This would work if mysqltest run would be threaded and handle each
|
||||
# connection in a separate thread.
|
||||
#
|
||||
|
||||
#-- source include/not_embedded.inc
|
||||
-- source include/have_bdb.inc
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
connect (con2,localhost,root,,);
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
connection con1;
|
||||
create table t1 (id integer, x integer) engine=BDB;
|
||||
create table t2 (id integer, x integer) engine=BDB;
|
||||
insert into t1 values(0, 0);
|
||||
insert into t2 values(0, 0);
|
||||
set autocommit=0;
|
||||
update t1 set x = 1 where id = 0;
|
||||
|
||||
connection con2;
|
||||
set autocommit=0;
|
||||
update t2 set x = 1 where id = 0;
|
||||
|
||||
# The following query should hang because con1 is locking the page
|
||||
--send
|
||||
select x from t1 where id = 0;
|
||||
|
||||
connection con1;
|
||||
# This should generate a deadlock as we are trying to access a locked row
|
||||
--send
|
||||
select x from t2 where id = 0;
|
||||
|
||||
connection con2;
|
||||
--error 1213
|
||||
reap;
|
||||
commit;
|
||||
|
||||
connection con1;
|
||||
reap;
|
||||
commit;
|
||||
|
||||
connection con2;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
commit;
|
||||
|
||||
connection con1;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
commit;
|
||||
|
||||
drop table t1,t2;
|
||||
|
||||
# End of 4.1 tests
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
--set-variable=query_cache_size=1M
|
||||
@@ -1,53 +0,0 @@
|
||||
-- source include/have_bdb.inc
|
||||
-- source include/have_query_cache.inc
|
||||
|
||||
#
|
||||
# Without auto_commit.
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2, t3;
|
||||
--enable_warnings
|
||||
flush status;
|
||||
set autocommit=0;
|
||||
create table t1 (a int not null) engine=bdb;
|
||||
insert into t1 values (1),(2),(3);
|
||||
select * from t1;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
drop table t1;
|
||||
set autocommit=1;
|
||||
create table t1 (a int not null) engine=bdb;
|
||||
begin;
|
||||
insert into t1 values (1),(2),(3);
|
||||
select * from t1;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
drop table t1;
|
||||
create table t1 (a int not null) engine=bdb;
|
||||
create table t2 (a int not null) engine=bdb;
|
||||
create table t3 (a int not null) engine=bdb;
|
||||
insert into t1 values (1),(2);
|
||||
insert into t2 values (1),(2);
|
||||
insert into t3 values (1),(2);
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
select * from t3;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_hits";
|
||||
begin;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
select * from t3;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_hits";
|
||||
insert into t1 values (3);
|
||||
insert into t2 values (3);
|
||||
insert into t1 values (4);
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
select * from t3;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_hits";
|
||||
commit;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
drop table if exists t1, t2, t3;
|
||||
|
||||
# End of 4.1 tests
|
||||
@@ -1,3 +0,0 @@
|
||||
-- source include/have_bdb.inc
|
||||
SET storage_engine=bdb;
|
||||
--source include/gis_generic.inc
|
||||
@@ -360,7 +360,7 @@ drop table t1;
|
||||
create table t1 (
|
||||
c char(10) character set utf8,
|
||||
unique key a (c(1))
|
||||
) engine=bdb;
|
||||
) engine=innodb;
|
||||
--enable_warnings
|
||||
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
||||
--error 1062
|
||||
@@ -483,7 +483,7 @@ drop table t1;
|
||||
create table t1 (
|
||||
c char(10) character set utf8 collate utf8_bin,
|
||||
unique key a (c(1))
|
||||
) engine=bdb;
|
||||
) engine=innodb;
|
||||
--enable_warnings
|
||||
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
||||
--error 1062
|
||||
@@ -558,7 +558,7 @@ drop table t1;
|
||||
create table t1 (
|
||||
str varchar(255) character set utf8 not null,
|
||||
key str (str(2))
|
||||
) engine=bdb;
|
||||
) engine=innodb;
|
||||
--enable_warnings
|
||||
INSERT INTO t1 VALUES ('str');
|
||||
INSERT INTO t1 VALUES ('str2');
|
||||
@@ -644,7 +644,7 @@ create table t1 (
|
||||
insert into t1 values(1,'foo'),(2,'foobar');
|
||||
select * from t1 where b like 'foob%';
|
||||
--disable_warnings
|
||||
alter table t1 engine=bdb;
|
||||
alter table t1 engine=innodb;
|
||||
--enable_warnings
|
||||
select * from t1 where b like 'foob%';
|
||||
drop table t1;
|
||||
|
||||
@@ -44,3 +44,4 @@ rpl_row_basic_7ndb : BUG#21298 2006-07-27 msvensson
|
||||
rpl_truncate_7ndb : BUG#21298 2006-07-27 msvensson
|
||||
crash_commit_before : 2006-08-02 msvensson
|
||||
rpl_ndb_dd_advance : BUG#18679 2006-07-28 jimw (Test fails randomly)
|
||||
federated_transactions : Need to be re-enabled once Patrick's merge is complete
|
||||
|
||||
@@ -10,7 +10,7 @@ CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(32) NOT NULL default ''
|
||||
)
|
||||
DEFAULT CHARSET=latin1 ENGINE=InnoDB;
|
||||
DEFAULT CHARSET=latin1 ENGINE=innodb;
|
||||
|
||||
connection master;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
#
|
||||
# 2-sweeps read Index_merge test
|
||||
#
|
||||
-- source include/have_bdb.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (
|
||||
pk int primary key,
|
||||
key1 int,
|
||||
key2 int,
|
||||
filler char(200),
|
||||
filler2 char(200),
|
||||
index(key1),
|
||||
index(key2)
|
||||
) engine=bdb;
|
||||
|
||||
|
||||
--disable_query_log
|
||||
let $1=1000;
|
||||
while ($1)
|
||||
{
|
||||
eval insert into t1 values($1, $1, $1, 'filler-data','filler-data-2');
|
||||
dec $1;
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
select * from t1 where (key1 >= 2 and key1 <= 10) or (pk >= 4 and pk <=8 );
|
||||
|
||||
set @maxv=1000;
|
||||
|
||||
select * from t1 where
|
||||
(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
|
||||
or key1=18 or key1=60;
|
||||
|
||||
select * from t1 where
|
||||
(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
|
||||
or key1 < 3 or key1 > @maxv-11;
|
||||
|
||||
select * from t1 where
|
||||
(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
|
||||
or
|
||||
(key1 < 5) or (key1 > 10 and key1 < 15) or (key1 >= 50 and key1 < 55 ) or (key1 > @maxv-10);
|
||||
|
||||
select * from t1 where
|
||||
(pk > 10 and pk < 15) or (pk >= 50 and pk < 55 )
|
||||
or
|
||||
(key1 < 5) or (key1 > @maxv-10);
|
||||
|
||||
drop table t1;
|
||||
@@ -485,7 +485,7 @@ delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
|
||||
drop table t1,t2;
|
||||
|
||||
--disable_warnings
|
||||
create table t1 ( c char(8) not null ) engine=bdb;
|
||||
create table t1 ( c char(8) not null ) engine=innodb;
|
||||
--enable_warnings
|
||||
|
||||
insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
###############################################
|
||||
# #
|
||||
# Prepared Statements test on BDB tables #
|
||||
# #
|
||||
###############################################
|
||||
|
||||
#
|
||||
# NOTE: PLEASE SEE ps_1general.test (bottom)
|
||||
# BEFORE ADDING NEW TEST CASES HERE !!!
|
||||
|
||||
use test;
|
||||
|
||||
-- source include/have_bdb.inc
|
||||
let $type= 'BDB' ;
|
||||
-- source include/ps_create.inc
|
||||
-- source include/ps_renew.inc
|
||||
|
||||
-- source include/ps_query.inc
|
||||
-- source include/ps_modify.inc
|
||||
-- source include/ps_modify1.inc
|
||||
-- source include/ps_conv.inc
|
||||
|
||||
drop table t1, t9;
|
||||
|
||||
# End of 4.1 tests
|
||||
@@ -1,108 +0,0 @@
|
||||
#
|
||||
# Test for rowid ordering (and comparison) functions.
|
||||
# do index_merge select for tables with PK of various types.
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2, t3,t4;
|
||||
--enable_warnings
|
||||
|
||||
-- source include/have_bdb.inc
|
||||
|
||||
# Signed number as rowid
|
||||
create table t1 (
|
||||
pk1 int not NULL,
|
||||
key1 int(11),
|
||||
key2 int(11),
|
||||
PRIMARY KEY (pk1),
|
||||
KEY key1 (key1),
|
||||
KEY key2 (key2)
|
||||
) engine=bdb;
|
||||
insert into t1 values (-5, 1, 1),
|
||||
(-100, 1, 1),
|
||||
(3, 1, 1),
|
||||
(0, 1, 1),
|
||||
(10, 1, 1);
|
||||
explain select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
|
||||
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
|
||||
drop table t1;
|
||||
|
||||
# Unsigned numbers as rowids
|
||||
create table t1 (
|
||||
pk1 int unsigned not NULL,
|
||||
key1 int(11),
|
||||
key2 int(11),
|
||||
PRIMARY KEY (pk1),
|
||||
KEY key1 (key1),
|
||||
KEY key2 (key2)
|
||||
) engine=bdb;
|
||||
insert into t1 values (0, 1, 1),
|
||||
(0xFFFFFFFF, 1, 1),
|
||||
(0xFFFFFFFE, 1, 1),
|
||||
(1, 1, 1),
|
||||
(2, 1, 1);
|
||||
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
|
||||
drop table t1;
|
||||
|
||||
# Case-insensitive char(N)
|
||||
create table t1 (
|
||||
pk1 char(4) not NULL,
|
||||
key1 int(11),
|
||||
key2 int(11),
|
||||
PRIMARY KEY (pk1),
|
||||
KEY key1 (key1),
|
||||
KEY key2 (key2)
|
||||
) engine=bdb collate latin2_general_ci;
|
||||
insert into t1 values ('a1', 1, 1),
|
||||
('b2', 1, 1),
|
||||
('A3', 1, 1),
|
||||
('B4', 1, 1);
|
||||
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
|
||||
drop table t1;
|
||||
|
||||
# Multi-part PK
|
||||
create table t1 (
|
||||
pk1 int not NULL,
|
||||
pk2 char(4) not NULL collate latin1_german1_ci,
|
||||
pk3 char(4) not NULL collate latin1_bin,
|
||||
key1 int(11),
|
||||
key2 int(11),
|
||||
PRIMARY KEY (pk1,pk2,pk3),
|
||||
KEY key1 (key1),
|
||||
KEY key2 (key2)
|
||||
) engine=bdb;
|
||||
insert into t1 values
|
||||
(1, 'u', 'u', 1, 1),
|
||||
(1, 'u', char(0xEC), 1, 1),
|
||||
(1, 'u', 'x', 1, 1);
|
||||
insert ignore into t1 select pk1, char(0xEC), pk3, key1, key2 from t1;
|
||||
insert ignore into t1 select pk1, 'x', pk3, key1, key2 from t1 where pk2='u';
|
||||
insert ignore into t1 select 2, pk2, pk3, key1, key2 from t1;
|
||||
select * from t1;
|
||||
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
|
||||
|
||||
# Hidden PK
|
||||
alter table t1 drop primary key;
|
||||
select * from t1;
|
||||
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
|
||||
drop table t1;
|
||||
|
||||
# Variable-length PK
|
||||
# this is also test for Bug#2688
|
||||
create table t1 (
|
||||
pk1 varchar(8) NOT NULL default '',
|
||||
pk2 varchar(4) NOT NULL default '',
|
||||
key1 int(11),
|
||||
key2 int(11),
|
||||
primary key(pk1, pk2),
|
||||
KEY key1 (key1),
|
||||
KEY key2 (key2)
|
||||
) engine=bdb;
|
||||
insert into t1 values ('','empt',2,2),
|
||||
('a','a--a',2,2),
|
||||
('bb','b--b',2,2),
|
||||
('ccc','c--c',2,2),
|
||||
('dddd','d--d',2,2);
|
||||
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
|
||||
|
||||
drop table t1;
|
||||
|
||||
Reference in New Issue
Block a user