Commit cae4203f authored by unknown's avatar unknown

Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1-maint

into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/51


mysql-test/r/strict.result:
  Auto merged
mysql-test/r/type_date.result:
  Auto merged
mysql-test/t/strict.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
parents cca28984 c884a32c
...@@ -189,30 +189,28 @@ drop table t1; ...@@ -189,30 +189,28 @@ drop table t1;
# Test all MBR* functions and their non-MBR-prefixed aliases, # Test all MBR* functions and their non-MBR-prefixed aliases,
# using shifted squares to verify the spatial relations. # using shifted squares to verify the spatial relations.
# Primary key is needed for NDB with binlog; bug ARCHIVE doesn't CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
# support AUTO_INCREMENT, so specify id values explicitly
CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY);
INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))'));
INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))'));
INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))'));
INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))'));
INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
......
...@@ -461,22 +461,22 @@ insert into t1 (fl) values (pointfromtext('point(1,1)')); ...@@ -461,22 +461,22 @@ insert into t1 (fl) values (pointfromtext('point(1,1)'));
ERROR 23000: Column 'fl' cannot be null ERROR 23000: Column 'fl' cannot be null
drop table t1; drop table t1;
End of 4.1 tests End of 4.1 tests
CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY); CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))'));
INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))'));
INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))'));
INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))'));
INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrcontains mbrcontains
center,small center,small
......
...@@ -461,22 +461,22 @@ insert into t1 (fl) values (pointfromtext('point(1,1)')); ...@@ -461,22 +461,22 @@ insert into t1 (fl) values (pointfromtext('point(1,1)'));
ERROR 23000: Column 'fl' cannot be null ERROR 23000: Column 'fl' cannot be null
drop table t1; drop table t1;
End of 4.1 tests End of 4.1 tests
CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY); CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))'));
INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))'));
INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))'));
INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))'));
INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrcontains mbrcontains
center,small center,small
......
...@@ -461,22 +461,24 @@ insert into t1 (fl) values (pointfromtext('point(1,1)')); ...@@ -461,22 +461,24 @@ insert into t1 (fl) values (pointfromtext('point(1,1)'));
ERROR 23000: Column 'fl' cannot be null ERROR 23000: Column 'fl' cannot be null
drop table t1; drop table t1;
End of 4.1 tests End of 4.1 tests
CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY); CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); Warnings:
INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))'));
INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))'));
INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))'));
INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))'));
INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrcontains mbrcontains
center,small center,small
...@@ -1009,22 +1011,24 @@ insert into t1 (fl) values (pointfromtext('point(1,1)')); ...@@ -1009,22 +1011,24 @@ insert into t1 (fl) values (pointfromtext('point(1,1)'));
ERROR 23000: Column 'fl' cannot be null ERROR 23000: Column 'fl' cannot be null
drop table t1; drop table t1;
End of 4.1 tests End of 4.1 tests
CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(100), square GEOMETRY); CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
INSERT INTO t1 VALUES( 1, "center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); Warnings:
INSERT INTO t1 VALUES( 2, "small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
INSERT INTO t1 VALUES( 3, "big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES( 4, "up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')); INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES( 5, "up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))')); INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
INSERT INTO t1 VALUES( 6, "up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')); INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
INSERT INTO t1 VALUES( 7, "down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')); INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
INSERT INTO t1 VALUES( 8, "down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))')); INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
INSERT INTO t1 VALUES( 9, "down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')); INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))'));
INSERT INTO t1 VALUES(10, "right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')); INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))'));
INSERT INTO t1 VALUES(11, "right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')); INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
INSERT INTO t1 VALUES(12, "right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))')); INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
INSERT INTO t1 VALUES(13, "left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))')); INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
INSERT INTO t1 VALUES(14, "left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))')); INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
INSERT INTO t1 VALUES(15, "left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')); INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))'));
INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))'));
INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrcontains mbrcontains
center,small center,small
......
...@@ -1810,7 +1810,6 @@ select a,hex(s1) from t1; ...@@ -1810,7 +1810,6 @@ select a,hex(s1) from t1;
select hex(s1) from t2; select hex(s1) from t2;
drop table t2,t1; drop table t2,t1;
# Ensure that <tablename>_ibfk_0 is not mistreated as a # Ensure that <tablename>_ibfk_0 is not mistreated as a
# generated foreign key identifier. (Bug #16387) # generated foreign key identifier. (Bug #16387)
......
...@@ -89,6 +89,8 @@ EXTRA_DIST = include/btr0btr.h include/btr0btr.ic include/btr0cur.h include/btr ...@@ -89,6 +89,8 @@ EXTRA_DIST = include/btr0btr.h include/btr0btr.ic include/btr0cur.h include/btr
include/ut0sort.h include/ut0ut.h include/ut0ut.ic include/ut0vec.h include/ut0vec.ic include/ha_prototypes.h \ include/ut0sort.h include/ut0ut.h include/ut0ut.ic include/ut0vec.h include/ut0vec.ic include/ha_prototypes.h \
include/ut0list.h include/ut0list.ic \ include/ut0list.h include/ut0list.ic \
include/ut0wqueue.h \ include/ut0wqueue.h \
pars/make_bison.sh pars/make_flex.sh \
pars/pars0grm.y pars/pars0lex.l
CMakeLists.txt plug.in CMakeLists.txt plug.in
noinst_LIBRARIES = libinnobase.a noinst_LIBRARIES = libinnobase.a
......
...@@ -689,7 +689,8 @@ dict_table_get_on_id( ...@@ -689,7 +689,8 @@ dict_table_get_on_id(
if we are doing a rollback to handle an error in TABLE if we are doing a rollback to handle an error in TABLE
CREATE, for example, we already have the mutex! */ CREATE, for example, we already have the mutex! */
ut_ad(mutex_own(&(dict_sys->mutex))); ut_ad(mutex_own(&(dict_sys->mutex))
|| trx->dict_operation_lock_mode == RW_X_LATCH);
return(dict_table_get_on_id_low(table_id)); return(dict_table_get_on_id_low(table_id));
} }
......
...@@ -92,9 +92,6 @@ extern "C" { ...@@ -92,9 +92,6 @@ extern "C" {
#include "../storage/innobase/include/ha_prototypes.h" #include "../storage/innobase/include/ha_prototypes.h"
} }
#define HA_INNOBASE_ROWS_IN_TABLE 10000 /* to get optimization right */
#define HA_INNOBASE_RANGE_COUNT 100
ulong innobase_large_page_size = 0; ulong innobase_large_page_size = 0;
/* The default values for the following, type long or longlong, start-up /* The default values for the following, type long or longlong, start-up
...@@ -142,7 +139,7 @@ srv_active_wake_master_thread after each fetch or search, we only do ...@@ -142,7 +139,7 @@ srv_active_wake_master_thread after each fetch or search, we only do
it every INNOBASE_WAKE_INTERVAL'th step. */ it every INNOBASE_WAKE_INTERVAL'th step. */
#define INNOBASE_WAKE_INTERVAL 32 #define INNOBASE_WAKE_INTERVAL 32
ulong innobase_active_counter = 0; static ulong innobase_active_counter = 0;
static HASH innobase_open_tables; static HASH innobase_open_tables;
...@@ -311,13 +308,13 @@ bool innobase_show_status(handlerton *hton, THD* thd, ...@@ -311,13 +308,13 @@ bool innobase_show_status(handlerton *hton, THD* thd,
/********************************************************************* /*********************************************************************
Commits a transaction in an InnoDB database. */ Commits a transaction in an InnoDB database. */
static
void void
innobase_commit_low( innobase_commit_low(
/*================*/ /*================*/
trx_t* trx); /* in: transaction handle */ trx_t* trx); /* in: transaction handle */
SHOW_VAR innodb_status_variables[]= { static SHOW_VAR innodb_status_variables[]= {
{"buffer_pool_pages_data", {"buffer_pool_pages_data",
(char*) &export_vars.innodb_buffer_pool_pages_data, SHOW_LONG}, (char*) &export_vars.innodb_buffer_pool_pages_data, SHOW_LONG},
{"buffer_pool_pages_dirty", {"buffer_pool_pages_dirty",
...@@ -1140,7 +1137,7 @@ holding any InnoDB semaphores. The calling thread is holding the ...@@ -1140,7 +1137,7 @@ holding any InnoDB semaphores. The calling thread is holding the
query cache mutex, and this function will reserver the InnoDB kernel mutex. query cache mutex, and this function will reserver the InnoDB kernel mutex.
Thus, the 'rank' in sync0sync.h of the MySQL query cache mutex is above Thus, the 'rank' in sync0sync.h of the MySQL query cache mutex is above
the InnoDB kernel mutex. */ the InnoDB kernel mutex. */
static
my_bool my_bool
innobase_query_caching_of_table_permitted( innobase_query_caching_of_table_permitted(
/*======================================*/ /*======================================*/
...@@ -1765,7 +1762,7 @@ innobase_flush_logs(handlerton *hton) ...@@ -1765,7 +1762,7 @@ innobase_flush_logs(handlerton *hton)
/********************************************************************* /*********************************************************************
Commits a transaction in an InnoDB database. */ Commits a transaction in an InnoDB database. */
static
void void
innobase_commit_low( innobase_commit_low(
/*================*/ /*================*/
...@@ -1849,12 +1846,11 @@ innobase_commit( ...@@ -1849,12 +1846,11 @@ innobase_commit(
/* Update the info whether we should skip XA steps that eat CPU time */ /* Update the info whether we should skip XA steps that eat CPU time */
trx->support_xa = (ibool)(thd->variables.innodb_support_xa); trx->support_xa = (ibool)(thd->variables.innodb_support_xa);
/* Release a possible FIFO ticket and search latch. Since we will /* Since we will reserve the kernel mutex, we have to release
reserve the kernel mutex, we have to release the search system latch the search system latch first to obey the latching order. */
first to obey the latching order. */
if (trx->has_search_latch) { if (trx->has_search_latch) {
trx_search_latch_release_if_reserved(trx); trx_search_latch_release_if_reserved(trx);
} }
/* The flag trx->active_trans is set to 1 in /* The flag trx->active_trans is set to 1 in
...@@ -1941,18 +1937,20 @@ retry: ...@@ -1941,18 +1937,20 @@ retry:
trx_mark_sql_stat_end(trx); trx_mark_sql_stat_end(trx);
} }
/* Tell the InnoDB server that there might be work for utility
threads: */
if (trx->declared_to_be_inside_innodb) { if (trx->declared_to_be_inside_innodb) {
/* Release our possible ticket in the FIFO */ /* Release our possible ticket in the FIFO */
srv_conc_force_exit_innodb(trx); srv_conc_force_exit_innodb(trx);
} }
/* Tell the InnoDB server that there might be work for utility
threads: */
srv_active_wake_master_thread(); srv_active_wake_master_thread();
DBUG_RETURN(0); DBUG_RETURN(0);
} }
#if 0
/* TODO: put the /* TODO: put the
MySQL-4.1 functionality back to 5.0. This is needed to get InnoDB Hot Backup MySQL-4.1 functionality back to 5.0. This is needed to get InnoDB Hot Backup
to work. */ to work. */
...@@ -1965,7 +1963,7 @@ transaction inside InnoDB but does NOT flush InnoDB log files to disk. ...@@ -1965,7 +1963,7 @@ transaction inside InnoDB but does NOT flush InnoDB log files to disk.
To flush you have to call innobase_commit_complete(). We have separated To flush you have to call innobase_commit_complete(). We have separated
flushing to eliminate the bottleneck of LOCK_log in log.cc which disabled flushing to eliminate the bottleneck of LOCK_log in log.cc which disabled
InnoDB's group commit capability. */ InnoDB's group commit capability. */
static
int int
innobase_report_binlog_offset_and_commit( innobase_report_binlog_offset_and_commit(
/*=====================================*/ /*=====================================*/
...@@ -1995,7 +1993,6 @@ innobase_report_binlog_offset_and_commit( ...@@ -1995,7 +1993,6 @@ innobase_report_binlog_offset_and_commit(
return(0); return(0);
} }
#if 0
/*********************************************************************** /***********************************************************************
This function stores the binlog offset and flushes logs. */ This function stores the binlog offset and flushes logs. */
static static
...@@ -2026,12 +2023,11 @@ innobase_store_binlog_offset_and_flush_log( ...@@ -2026,12 +2023,11 @@ innobase_store_binlog_offset_and_flush_log(
/* Synchronous flush of the log buffer to disk */ /* Synchronous flush of the log buffer to disk */
log_buffer_flush_to_disk(); log_buffer_flush_to_disk();
} }
#endif
/********************************************************************* /*********************************************************************
This is called after MySQL has written the binlog entry for the current This is called after MySQL has written the binlog entry for the current
transaction. Flushes the InnoDB log files to disk if required. */ transaction. Flushes the InnoDB log files to disk if required. */
static
int int
innobase_commit_complete( innobase_commit_complete(
/*=====================*/ /*=====================*/
...@@ -2057,6 +2053,7 @@ innobase_commit_complete( ...@@ -2057,6 +2053,7 @@ innobase_commit_complete(
return(0); return(0);
} }
#endif
/********************************************************************* /*********************************************************************
Rolls back a transaction or the latest SQL statement. */ Rolls back a transaction or the latest SQL statement. */
...@@ -2110,7 +2107,7 @@ innobase_rollback( ...@@ -2110,7 +2107,7 @@ innobase_rollback(
/********************************************************************* /*********************************************************************
Rolls back a transaction */ Rolls back a transaction */
static
int int
innobase_rollback_trx( innobase_rollback_trx(
/*==================*/ /*==================*/
...@@ -2405,8 +2402,6 @@ ha_innobase::open( ...@@ -2405,8 +2402,6 @@ ha_innobase::open(
user_thd = NULL; user_thd = NULL;
last_query_id = (ulong)-1;
if (!(share=get_share(name))) { if (!(share=get_share(name))) {
DBUG_RETURN(1); DBUG_RETURN(1);
...@@ -3374,8 +3369,7 @@ ha_innobase::write_row( ...@@ -3374,8 +3369,7 @@ ha_innobase::write_row(
ut_error; ut_error;
} }
statistic_increment(thd->status_var.ha_write_count, ha_statistic_increment(&SSV::ha_write_count);
&LOCK_status);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
table->timestamp_field->set_time(); table->timestamp_field->set_time();
...@@ -3450,13 +3444,6 @@ no_commit: ...@@ -3450,13 +3444,6 @@ no_commit:
num_write_row++; num_write_row++;
if (last_query_id != user_thd->query_id) {
prebuilt->sql_stat_start = TRUE;
last_query_id = user_thd->query_id;
innobase_release_stat_resources(prebuilt->trx);
}
if (table->next_number_field && record == table->record[0]) { if (table->next_number_field && record == table->record[0]) {
/* This is the case where the table has an /* This is the case where the table has an
auto-increment column */ auto-increment column */
...@@ -3611,13 +3598,6 @@ calc_row_difference( ...@@ -3611,13 +3598,6 @@ calc_row_difference(
for (i = 0; i < n_fields; i++) { for (i = 0; i < n_fields; i++) {
field = table->field[i]; field = table->field[i];
/* if (thd->query_id != field->query_id) { */
/* TODO: check that these fields cannot have
changed! */
/* goto skip_field;
}*/
o_ptr = (byte*) old_row + get_field_offset(table, field); o_ptr = (byte*) old_row + get_field_offset(table, field);
n_ptr = (byte*) new_row + get_field_offset(table, field); n_ptr = (byte*) new_row + get_field_offset(table, field);
...@@ -3749,13 +3729,6 @@ ha_innobase::update_row( ...@@ -3749,13 +3729,6 @@ ha_innobase::update_row(
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
table->timestamp_field->set_time(); table->timestamp_field->set_time();
if (last_query_id != user_thd->query_id) {
prebuilt->sql_stat_start = TRUE;
last_query_id = user_thd->query_id;
innobase_release_stat_resources(trx);
}
if (prebuilt->upd_node) { if (prebuilt->upd_node) {
uvect = prebuilt->upd_node->update; uvect = prebuilt->upd_node->update;
} else { } else {
...@@ -3806,13 +3779,6 @@ ha_innobase::delete_row( ...@@ -3806,13 +3779,6 @@ ha_innobase::delete_row(
ut_a(prebuilt->trx == trx); ut_a(prebuilt->trx == trx);
if (last_query_id != user_thd->query_id) {
prebuilt->sql_stat_start = TRUE;
last_query_id = user_thd->query_id;
innobase_release_stat_resources(trx);
}
if (!prebuilt->upd_node) { if (!prebuilt->upd_node) {
row_get_prebuilt_update_vector(prebuilt); row_get_prebuilt_update_vector(prebuilt);
} }
...@@ -3848,15 +3814,6 @@ ha_innobase::unlock_row(void) ...@@ -3848,15 +3814,6 @@ ha_innobase::unlock_row(void)
{ {
DBUG_ENTER("ha_innobase::unlock_row"); DBUG_ENTER("ha_innobase::unlock_row");
if (UNIV_UNLIKELY(last_query_id != user_thd->query_id)) {
ut_print_timestamp(stderr);
sql_print_error("last_query_id is %lu != user_thd_query_id is "
"%lu", (ulong) last_query_id,
(ulong) user_thd->query_id);
mem_analyze_corruption(prebuilt->trx);
ut_error;
}
/* Consistent read does not take any locks, thus there is /* Consistent read does not take any locks, thus there is
nothing to unlock. */ nothing to unlock. */
...@@ -4062,15 +4019,7 @@ ha_innobase::index_read( ...@@ -4062,15 +4019,7 @@ ha_innobase::index_read(
ut_a(prebuilt->trx == thd_to_trx(current_thd, ht)); ut_a(prebuilt->trx == thd_to_trx(current_thd, ht));
statistic_increment(current_thd->status_var.ha_read_key_count, ha_statistic_increment(&SSV::ha_read_key_count);
&LOCK_status);
if (last_query_id != user_thd->query_id) {
prebuilt->sql_stat_start = TRUE;
last_query_id = user_thd->query_id;
innobase_release_stat_resources(prebuilt->trx);
}
index = prebuilt->index; index = prebuilt->index;
...@@ -4168,12 +4117,11 @@ ha_innobase::change_active_index( ...@@ -4168,12 +4117,11 @@ ha_innobase::change_active_index(
InnoDB */ InnoDB */
{ {
KEY* key=0; KEY* key=0;
THD* thd = current_thd; ha_statistic_increment(&SSV::ha_read_key_count);
statistic_increment(thd->status_var.ha_read_key_count, &LOCK_status);
DBUG_ENTER("change_active_index"); DBUG_ENTER("change_active_index");
ut_ad(user_thd == thd); ut_ad(user_thd == current_thd);
ut_a(prebuilt->trx == thd_to_trx(thd, ht)); ut_a(prebuilt->trx == thd_to_trx(user_thd, ht));
active_index = keynr; active_index = keynr;
...@@ -4300,8 +4248,7 @@ ha_innobase::index_next( ...@@ -4300,8 +4248,7 @@ ha_innobase::index_next(
mysql_byte* buf) /* in/out: buffer for next row in MySQL mysql_byte* buf) /* in/out: buffer for next row in MySQL
format */ format */
{ {
statistic_increment(current_thd->status_var.ha_read_next_count, ha_statistic_increment(&SSV::ha_read_next_count);
&LOCK_status);
return(general_fetch(buf, ROW_SEL_NEXT, 0)); return(general_fetch(buf, ROW_SEL_NEXT, 0));
} }
...@@ -4318,8 +4265,7 @@ ha_innobase::index_next_same( ...@@ -4318,8 +4265,7 @@ ha_innobase::index_next_same(
const mysql_byte* key, /* in: key value */ const mysql_byte* key, /* in: key value */
uint keylen) /* in: key value length */ uint keylen) /* in: key value length */
{ {
statistic_increment(current_thd->status_var.ha_read_next_count, ha_statistic_increment(&SSV::ha_read_next_count);
&LOCK_status);
return(general_fetch(buf, ROW_SEL_NEXT, last_match_mode)); return(general_fetch(buf, ROW_SEL_NEXT, last_match_mode));
} }
...@@ -4336,8 +4282,7 @@ ha_innobase::index_prev( ...@@ -4336,8 +4282,7 @@ ha_innobase::index_prev(
mysql_byte* buf) /* in/out: buffer for previous row in MySQL mysql_byte* buf) /* in/out: buffer for previous row in MySQL
format */ format */
{ {
statistic_increment(current_thd->status_var.ha_read_prev_count, ha_statistic_increment(&SSV::ha_read_prev_count);
&LOCK_status);
return(general_fetch(buf, ROW_SEL_PREV, 0)); return(general_fetch(buf, ROW_SEL_PREV, 0));
} }
...@@ -4356,8 +4301,7 @@ ha_innobase::index_first( ...@@ -4356,8 +4301,7 @@ ha_innobase::index_first(
int error; int error;
DBUG_ENTER("index_first"); DBUG_ENTER("index_first");
statistic_increment(current_thd->status_var.ha_read_first_count, ha_statistic_increment(&SSV::ha_read_first_count);
&LOCK_status);
error = index_read(buf, NULL, 0, HA_READ_AFTER_KEY); error = index_read(buf, NULL, 0, HA_READ_AFTER_KEY);
...@@ -4383,8 +4327,7 @@ ha_innobase::index_last( ...@@ -4383,8 +4327,7 @@ ha_innobase::index_last(
int error; int error;
DBUG_ENTER("index_last"); DBUG_ENTER("index_last");
statistic_increment(current_thd->status_var.ha_read_last_count, ha_statistic_increment(&SSV::ha_read_last_count);
&LOCK_status);
error = index_read(buf, NULL, 0, HA_READ_BEFORE_KEY); error = index_read(buf, NULL, 0, HA_READ_BEFORE_KEY);
...@@ -4454,8 +4397,7 @@ ha_innobase::rnd_next( ...@@ -4454,8 +4397,7 @@ ha_innobase::rnd_next(
int error; int error;
DBUG_ENTER("rnd_next"); DBUG_ENTER("rnd_next");
statistic_increment(current_thd->status_var.ha_read_rnd_next_count, ha_statistic_increment(&SSV::ha_read_rnd_next_count);
&LOCK_status);
if (start_of_scan) { if (start_of_scan) {
error = index_first(buf); error = index_first(buf);
...@@ -4490,8 +4432,7 @@ ha_innobase::rnd_pos( ...@@ -4490,8 +4432,7 @@ ha_innobase::rnd_pos(
DBUG_ENTER("rnd_pos"); DBUG_ENTER("rnd_pos");
DBUG_DUMP("key", (char*) pos, ref_length); DBUG_DUMP("key", (char*) pos, ref_length);
statistic_increment(current_thd->status_var.ha_read_rnd_count, ha_statistic_increment(&SSV::ha_read_rnd_count);
&LOCK_status);
ut_a(prebuilt->trx == thd_to_trx(current_thd, ht)); ut_a(prebuilt->trx == thd_to_trx(current_thd, ht));
...@@ -6534,7 +6475,7 @@ ha_innobase::transactional_table_lock( ...@@ -6534,7 +6475,7 @@ ha_innobase::transactional_table_lock(
/**************************************************************************** /****************************************************************************
Here we export InnoDB status variables to MySQL. */ Here we export InnoDB status variables to MySQL. */
static
int int
innodb_export_status() innodb_export_status()
/*==================*/ /*==================*/
...@@ -6640,7 +6581,7 @@ innodb_show_status( ...@@ -6640,7 +6581,7 @@ innodb_show_status(
/**************************************************************************** /****************************************************************************
Implements the SHOW MUTEX STATUS command. . */ Implements the SHOW MUTEX STATUS command. . */
static
bool bool
innodb_mutex_show_status( innodb_mutex_show_status(
/*=====================*/ /*=====================*/
...@@ -7325,6 +7266,33 @@ ha_innobase::cmp_ref( ...@@ -7325,6 +7266,33 @@ ha_innobase::cmp_ref(
return(0); return(0);
} }
/***********************************************************************
Ask InnoDB if a query to a table can be cached. */
my_bool
ha_innobase::register_query_cache_table(
/*====================================*/
/* out: TRUE if query caching
of the table is permitted */
THD* thd, /* in: user thread handle */
char* table_key, /* in: concatenation of database name,
the null character '\0',
and the table name */
uint key_length, /* in: length of the full name, i.e.
len(dbname) + len(tablename) + 1 */
qc_engine_callback*
call_back, /* out: pointer to function for
checking if query caching
is permitted */
ulonglong *engine_data) /* in/out: data to call_back */
{
*call_back = innobase_query_caching_of_table_permitted;
*engine_data = 0;
return(innobase_query_caching_of_table_permitted(thd, table_key,
key_length,
engine_data));
}
char* char*
ha_innobase::get_mysql_bin_log_name() ha_innobase::get_mysql_bin_log_name()
{ {
...@@ -7702,12 +7670,12 @@ static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff) ...@@ -7702,12 +7670,12 @@ static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff)
return 0; return 0;
} }
SHOW_VAR innodb_status_variables_export[]= { static SHOW_VAR innodb_status_variables_export[]= {
{"Innodb", (char*) &show_innodb_vars, SHOW_FUNC}, {"Innodb", (char*) &show_innodb_vars, SHOW_FUNC},
{NullS, NullS, SHOW_LONG} {NullS, NullS, SHOW_LONG}
}; };
struct st_mysql_storage_engine innobase_storage_engine= static struct st_mysql_storage_engine innobase_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION }; { MYSQL_HANDLERTON_INTERFACE_VERSION };
mysql_declare_plugin(innobase) mysql_declare_plugin(innobase)
......
...@@ -35,10 +35,6 @@ typedef struct st_innobase_share { ...@@ -35,10 +35,6 @@ typedef struct st_innobase_share {
struct row_prebuilt_struct; struct row_prebuilt_struct;
typedef struct row_prebuilt_struct row_prebuilt_t; typedef struct row_prebuilt_struct row_prebuilt_t;
my_bool innobase_query_caching_of_table_permitted(THD* thd, char* full_name,
uint full_name_len,
ulonglong *unused);
/* The class defining a handle to an Innodb table */ /* The class defining a handle to an Innodb table */
class ha_innobase: public handler class ha_innobase: public handler
{ {
...@@ -48,8 +44,6 @@ class ha_innobase: public handler ...@@ -48,8 +44,6 @@ class ha_innobase: public handler
THD* user_thd; /* the thread handle of the user THD* user_thd; /* the thread handle of the user
currently using the handle; this is currently using the handle; this is
set in external_lock function */ set in external_lock function */
query_id_t last_query_id; /* the latest query id where the
handle was used */
THR_LOCK_DATA lock; THR_LOCK_DATA lock;
INNOBASE_SHARE *share; INNOBASE_SHARE *share;
...@@ -186,14 +180,7 @@ class ha_innobase: public handler ...@@ -186,14 +180,7 @@ class ha_innobase: public handler
my_bool register_query_cache_table(THD *thd, char *table_key, my_bool register_query_cache_table(THD *thd, char *table_key,
uint key_length, uint key_length,
qc_engine_callback *call_back, qc_engine_callback *call_back,
ulonglong *engine_data) ulonglong *engine_data);
{
*call_back= innobase_query_caching_of_table_permitted;
*engine_data= 0;
return innobase_query_caching_of_table_permitted(thd, table_key,
key_length,
engine_data);
}
static char *get_mysql_bin_log_name(); static char *get_mysql_bin_log_name();
static ulonglong get_mysql_bin_log_pos(); static ulonglong get_mysql_bin_log_pos();
bool primary_key_is_clustered() { return true; } bool primary_key_is_clustered() { return true; }
...@@ -202,7 +189,6 @@ class ha_innobase: public handler ...@@ -202,7 +189,6 @@ class ha_innobase: public handler
uint table_changes); uint table_changes);
}; };
extern SHOW_VAR innodb_status_variables[];
extern ulong innobase_fast_shutdown; extern ulong innobase_fast_shutdown;
extern ulong innobase_large_page_size; extern ulong innobase_large_page_size;
extern long innobase_mirrored_log_groups, innobase_log_files_in_group; extern long innobase_mirrored_log_groups, innobase_log_files_in_group;
......
...@@ -375,8 +375,6 @@ trx_is_interrupted( ...@@ -375,8 +375,6 @@ trx_is_interrupted(
/* Signal to a transaction */ /* Signal to a transaction */
struct trx_sig_struct{ struct trx_sig_struct{
ulint type; /* signal type */ ulint type; /* signal type */
ulint state; /* TRX_SIG_WAITING or
TRX_SIG_BEING_HANDLED */
ulint sender; /* TRX_SIG_SELF or ulint sender; /* TRX_SIG_SELF or
TRX_SIG_OTHER_SESS */ TRX_SIG_OTHER_SESS */
que_thr_t* receiver; /* non-NULL if the sender of the signal que_thr_t* receiver; /* non-NULL if the sender of the signal
...@@ -404,7 +402,7 @@ struct trx_struct{ ...@@ -404,7 +402,7 @@ struct trx_struct{
const char* op_info; /* English text describing the const char* op_info; /* English text describing the
current operation, or an empty current operation, or an empty
string */ string */
ulint type; /* TRX_USER, TRX_PURGE */ unsigned is_purge:1; /* 0=user transaction, 1=purge */
ulint conc_state; /* state of the trx from the point ulint conc_state; /* state of the trx from the point
of view of concurrency control: of view of concurrency control:
TRX_ACTIVE, TRX_COMMITTED_IN_MEMORY, TRX_ACTIVE, TRX_COMMITTED_IN_MEMORY,
...@@ -675,12 +673,6 @@ struct trx_struct{ ...@@ -675,12 +673,6 @@ struct trx_struct{
single operation of a single operation of a
transaction, e.g., a parallel transaction, e.g., a parallel
query */ query */
/* Transaction types */
#define TRX_USER 1 /* normal user transaction */
#define TRX_PURGE 2 /* purge transaction: this is not
inserted to the trx list of trx_sys
and no rollback segment is assigned to
this */
/* Transaction concurrency states */ /* Transaction concurrency states */
#define TRX_NOT_STARTED 1 #define TRX_NOT_STARTED 1
#define TRX_ACTIVE 2 #define TRX_ACTIVE 2
...@@ -742,9 +734,6 @@ struct trx_struct{ ...@@ -742,9 +734,6 @@ struct trx_struct{
session */ session */
#define TRX_SIG_OTHER_SESS 2 /* sent by another session (which #define TRX_SIG_OTHER_SESS 2 /* sent by another session (which
must hold rights to this) */ must hold rights to this) */
/* Signal states */
#define TRX_SIG_WAITING 1
#define TRX_SIG_BEING_HANDLED 2
/* Commit command node in a query graph */ /* Commit command node in a query graph */
struct commit_node_struct{ struct commit_node_struct{
......
...@@ -930,7 +930,7 @@ try_again: ...@@ -930,7 +930,7 @@ try_again:
file = CreateFile((LPCTSTR) name, file = CreateFile((LPCTSTR) name,
access, access,
FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
/* file can be read ansd written also /* file can be read and written also
by other processes */ by other processes */
NULL, /* default security attributes */ NULL, /* default security attributes */
create_flag, create_flag,
...@@ -1509,7 +1509,7 @@ os_file_rename( ...@@ -1509,7 +1509,7 @@ os_file_rename(
return(TRUE); return(TRUE);
} }
os_file_handle_error(oldpath, "rename"); os_file_handle_error_no_exit(oldpath, "rename");
return(FALSE); return(FALSE);
#else #else
...@@ -1518,7 +1518,7 @@ os_file_rename( ...@@ -1518,7 +1518,7 @@ os_file_rename(
ret = rename((const char*)oldpath, (const char*)newpath); ret = rename((const char*)oldpath, (const char*)newpath);
if (ret != 0) { if (ret != 0) {
os_file_handle_error(oldpath, "rename"); os_file_handle_error_no_exit(oldpath, "rename");
return(FALSE); return(FALSE);
} }
......
...@@ -213,7 +213,7 @@ row_undo( ...@@ -213,7 +213,7 @@ row_undo(
ulint err; ulint err;
trx_t* trx; trx_t* trx;
dulint roll_ptr; dulint roll_ptr;
ibool froze_data_dict = FALSE; ibool locked_data_dict;
ut_ad(node && thr); ut_ad(node && thr);
...@@ -266,13 +266,13 @@ row_undo( ...@@ -266,13 +266,13 @@ row_undo(
/* Prevent DROP TABLE etc. while we are rolling back this row. /* Prevent DROP TABLE etc. while we are rolling back this row.
If we are doing a TABLE CREATE or some other dictionary operation, If we are doing a TABLE CREATE or some other dictionary operation,
then we already have dict_operation_lock locked in x-mode. Do not then we already have dict_operation_lock locked in x-mode. Do not
try to lock again in s-mode, because that would cause a hang. */ try to lock again, because that would cause a hang. */
if (trx->dict_operation_lock_mode == 0) { locked_data_dict = (trx->dict_operation_lock_mode == 0);
row_mysql_freeze_data_dictionary(trx); if (locked_data_dict) {
froze_data_dict = TRUE; row_mysql_lock_data_dictionary(trx);
} }
if (node->state == UNDO_NODE_INSERT) { if (node->state == UNDO_NODE_INSERT) {
...@@ -285,9 +285,9 @@ row_undo( ...@@ -285,9 +285,9 @@ row_undo(
err = row_undo_mod(node, thr); err = row_undo_mod(node, thr);
} }
if (froze_data_dict) { if (locked_data_dict) {
row_mysql_unfreeze_data_dictionary(trx); row_mysql_unlock_data_dictionary(trx);
} }
/* Do some cleanup */ /* Do some cleanup */
......
...@@ -221,7 +221,7 @@ trx_purge_sys_create(void) ...@@ -221,7 +221,7 @@ trx_purge_sys_create(void)
purge_sys->trx = purge_sys->sess->trx; purge_sys->trx = purge_sys->sess->trx;
purge_sys->trx->type = TRX_PURGE; purge_sys->trx->is_purge = 1;
ut_a(trx_start_low(purge_sys->trx, ULINT_UNDEFINED)); ut_a(trx_start_low(purge_sys->trx, ULINT_UNDEFINED));
......
...@@ -109,7 +109,7 @@ trx_create( ...@@ -109,7 +109,7 @@ trx_create(
trx->op_info = ""; trx->op_info = "";
trx->type = TRX_USER; trx->is_purge = 0;
trx->conc_state = TRX_NOT_STARTED; trx->conc_state = TRX_NOT_STARTED;
trx->start_time = time(NULL); trx->start_time = time(NULL);
...@@ -667,7 +667,7 @@ trx_start_low( ...@@ -667,7 +667,7 @@ trx_start_low(
ut_ad(mutex_own(&kernel_mutex)); ut_ad(mutex_own(&kernel_mutex));
ut_ad(trx->rseg == NULL); ut_ad(trx->rseg == NULL);
if (trx->type == TRX_PURGE) { if (trx->is_purge) {
trx->id = ut_dulint_zero; trx->id = ut_dulint_zero;
trx->conc_state = TRX_ACTIVE; trx->conc_state = TRX_ACTIVE;
trx->start_time = time(NULL); trx->start_time = time(NULL);
...@@ -1262,7 +1262,6 @@ trx_sig_send( ...@@ -1262,7 +1262,6 @@ trx_sig_send(
UT_LIST_ADD_LAST(signals, trx->signals, sig); UT_LIST_ADD_LAST(signals, trx->signals, sig);
sig->type = type; sig->type = type;
sig->state = TRX_SIG_WAITING;
sig->sender = sender; sig->sender = sender;
sig->receiver = receiver_thr; sig->receiver = receiver_thr;
...@@ -1709,7 +1708,7 @@ trx_print( ...@@ -1709,7 +1708,7 @@ trx_print(
fputs(trx->op_info, f); fputs(trx->op_info, f);
} }
if (trx->type != TRX_USER) { if (trx->is_purge) {
fputs(" purge trx", f); fputs(" purge trx", f);
} }
......
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