mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge mysql.com:/home/hf/work/embt/my50-embt
into mysql.com:/home/hf/work/embt/my51-embt
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
top_builddir=../..
|
||||
mysql_test_dir=$top_builddir/mysql-test
|
||||
examples=$top_builddir/libmysqld/examples
|
||||
mysqltest=$examples/mysqltest
|
||||
mysqltest=$examples/mysqltest_embedded
|
||||
datadir=$mysql_test_dir/var/master-data
|
||||
test_data_dir=test
|
||||
gdb=0
|
||||
|
@ -584,6 +584,7 @@ void *create_embedded_thd(int client_flag)
|
||||
thd->set_time();
|
||||
thd->init_for_queries();
|
||||
thd->client_capabilities= client_flag;
|
||||
thd->real_id= (pthread_t) thd;
|
||||
|
||||
thd->db= NULL;
|
||||
thd->db_length= 0;
|
||||
@ -769,6 +770,8 @@ MYSQL_DATA *THD::alloc_new_dataset()
|
||||
|
||||
static void write_eof_packet(THD *thd)
|
||||
{
|
||||
if (!thd->mysql) // bootstrap file handling
|
||||
return;
|
||||
/*
|
||||
The following test should never be true, but it's better to do it
|
||||
because if 'is_fatal_error' is set the server is not going to execute
|
||||
@ -1028,6 +1031,9 @@ void Protocol_simple::prepare_for_resend()
|
||||
MYSQL_DATA *data= thd->cur_data;
|
||||
DBUG_ENTER("send_data");
|
||||
|
||||
if (!thd->mysql) // bootstrap file handling
|
||||
DBUG_VOID_RETURN;
|
||||
|
||||
data->rows++;
|
||||
if (!(cur= (MYSQL_ROWS *)alloc_root(alloc, sizeof(MYSQL_ROWS)+(field_count + 1) * sizeof(char *))))
|
||||
{
|
||||
|
@ -1,3 +1,4 @@
|
||||
--source include/not_embedded.inc
|
||||
--source ./include/have_federated_db.inc
|
||||
|
||||
source ./include/master-slave.inc;
|
||||
|
@ -37,18 +37,3 @@ show create database test;
|
||||
Database Create Database
|
||||
test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */
|
||||
drop table t1;
|
||||
create table t1 (a int) engine=innodb;
|
||||
reset master;
|
||||
set autocommit=0;
|
||||
insert t1 values (1);
|
||||
flush tables with read lock;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 102
|
||||
commit;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 102
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
set autocommit=1;
|
||||
|
15
mysql-test/r/flush_block_commit_notembedded.result
Normal file
15
mysql-test/r/flush_block_commit_notembedded.result
Normal file
@ -0,0 +1,15 @@
|
||||
create table t1 (a int) engine=innodb;
|
||||
reset master;
|
||||
set autocommit=0;
|
||||
insert t1 values (1);
|
||||
flush tables with read lock;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 98
|
||||
commit;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 98
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
set autocommit=1;
|
@ -321,12 +321,6 @@ ERROR 42000: Column 'b' specified twice
|
||||
INSERT INTO t1 (b,b) SELECT 0,0 ON DUPLICATE KEY UPDATE a = a + VALUES (a);
|
||||
ERROR 42000: Column 'b' specified twice
|
||||
drop table t1;
|
||||
create table t1 (n int);
|
||||
create view v1 as select * from t1;
|
||||
insert delayed into v1 values (1);
|
||||
ERROR HY000: 'test.v1' is not BASE TABLE
|
||||
drop table t1;
|
||||
drop view v1;
|
||||
create table t1 (id int primary key, data int);
|
||||
insert into t1 values (1, 1), (2, 2), (3, 3);
|
||||
select row_count();
|
||||
|
107
mysql-test/r/insert_notembedded.result
Normal file
107
mysql-test/r/insert_notembedded.result
Normal file
@ -0,0 +1,107 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (n int);
|
||||
create view v1 as select * from t1;
|
||||
insert delayed into v1 values (1);
|
||||
ERROR HY000: 'test.v1' is not BASE TABLE
|
||||
drop table t1;
|
||||
drop view v1;
|
||||
CREATE DATABASE meow;
|
||||
CREATE TABLE table_target ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target2 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target3 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE VIEW view_target2 AS SELECT mexs_id,messzeit FROM table_target2;
|
||||
CREATE SQL SECURITY INVOKER VIEW view_target3 AS SELECT mexs_id,messzeit FROM table_target3;
|
||||
CREATE TABLE table_stations ( mexs_id VARCHAR(8), icao VARCHAR(4), country CHAR(2), PRIMARY KEY (mexs_id), UNIQUE KEY icao (icao), KEY country (country), CONSTRAINT stations_ibfk_8 FOREIGN KEY (country) REFERENCES countries (country) ON UPDATE CASCADE);
|
||||
INSERT INTO table_stations VALUES ('87654321','XXXX','YY');
|
||||
CREATE TABLE table_countries ( country CHAR(2), iso_short_en VARCHAR(64), PRIMARY KEY (country));
|
||||
INSERT INTO table_countries VALUES ('YY','Entenhausen');
|
||||
CREATE ALGORITHM=MERGE SQL SECURITY INVOKER VIEW view_stations AS select table_stations.mexs_id AS mexs_id, table_stations.icao AS icao, table_stations.country AS landescode from (table_stations join table_countries on((table_stations.country = table_countries.country)));
|
||||
CREATE TABLE table_source ( id varchar(4), datetime TIMESTAMP, PRIMARY KEY (id));
|
||||
INSERT INTO table_source VALUES ('XXXX','2006-07-12 07:50:00');
|
||||
GRANT SELECT ON table_source TO user20989@localhost;
|
||||
GRANT SELECT ON table_countries TO user20989@localhost;
|
||||
GRANT SELECT ON table_stations TO user20989@localhost;
|
||||
GRANT SELECT ON view_stations TO user20989@localhost;
|
||||
GRANT SELECT ON table_target TO user20989@localhost;
|
||||
GRANT SELECT ON table_target2 TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON view_target3 TO user20989@localhost;
|
||||
REPLACE INTO table_target
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN table_target AS old
|
||||
USING (mexs_id);
|
||||
ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'table_target'
|
||||
REPLACE INTO view_target2
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'view_target2'
|
||||
REPLACE INTO view_target3
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target3 AS old
|
||||
USING (mexs_id);
|
||||
ERROR HY000: View 'meow.view_target3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
GRANT INSERT,DELETE ON table_target TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON view_target2 TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON table_target3 TO user20989@localhost;
|
||||
REPLACE INTO table_target
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN table_target AS old
|
||||
USING (mexs_id);
|
||||
REPLACE INTO table_target2 VALUES ('00X45Y78','2006-07-12 07:50:00');
|
||||
ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'table_target2'
|
||||
REPLACE INTO view_target2 VALUES ('12X45Y78','2006-07-12 07:50:00');
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
mexs_id messzeit
|
||||
87654321 2006-07-12 07:50:00
|
||||
REPLACE INTO view_target2
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
REPLACE INTO view_target3
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target3 AS old
|
||||
USING (mexs_id);
|
||||
SELECT * FROM table_target;
|
||||
mexs_id messzeit
|
||||
87654321 2006-07-12 07:50:00
|
||||
SELECT * FROM view_target2;
|
||||
mexs_id messzeit
|
||||
12X45Y78 2006-07-12 07:50:00
|
||||
87654321 2006-07-12 07:50:00
|
||||
SELECT * FROM view_target3;
|
||||
mexs_id messzeit
|
||||
87654321 2006-07-12 07:50:00
|
||||
DROP VIEW view_stations;
|
||||
DROP TABLE table_source;
|
||||
DROP TABLE table_countries;
|
||||
DROP TABLE table_stations;
|
||||
DROP TABLE table_target;
|
||||
DROP TABLE table_target2;
|
||||
DROP TABLE table_target3;
|
||||
DROP VIEW view_target2;
|
||||
DROP VIEW view_target3;
|
||||
DROP USER user20989@localhost;
|
||||
DROP DATABASE meow;
|
@ -705,103 +705,3 @@ use bug21774_1;
|
||||
INSERT INTO bug21774_2.t1 SELECT t1.* FROM t1;
|
||||
DROP DATABASE bug21774_1;
|
||||
DROP DATABASE bug21774_2;
|
||||
CREATE DATABASE meow;
|
||||
CREATE TABLE table_target ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target2 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target3 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE VIEW view_target2 AS SELECT mexs_id,messzeit FROM table_target2;
|
||||
CREATE SQL SECURITY INVOKER VIEW view_target3 AS SELECT mexs_id,messzeit FROM table_target3;
|
||||
CREATE TABLE table_stations ( mexs_id VARCHAR(8), icao VARCHAR(4), country CHAR(2), PRIMARY KEY (mexs_id), UNIQUE KEY icao (icao), KEY country (country), CONSTRAINT stations_ibfk_8 FOREIGN KEY (country) REFERENCES countries (country) ON UPDATE CASCADE);
|
||||
INSERT INTO table_stations VALUES ('87654321','XXXX','YY');
|
||||
CREATE TABLE table_countries ( country CHAR(2), iso_short_en VARCHAR(64), PRIMARY KEY (country));
|
||||
INSERT INTO table_countries VALUES ('YY','Entenhausen');
|
||||
CREATE ALGORITHM=MERGE SQL SECURITY INVOKER VIEW view_stations AS select table_stations.mexs_id AS mexs_id, table_stations.icao AS icao, table_stations.country AS landescode from (table_stations join table_countries on((table_stations.country = table_countries.country)));
|
||||
CREATE TABLE table_source ( id varchar(4), datetime TIMESTAMP, PRIMARY KEY (id));
|
||||
INSERT INTO table_source VALUES ('XXXX','2006-07-12 07:50:00');
|
||||
GRANT SELECT ON table_source TO user20989@localhost;
|
||||
GRANT SELECT ON table_countries TO user20989@localhost;
|
||||
GRANT SELECT ON table_stations TO user20989@localhost;
|
||||
GRANT SELECT ON view_stations TO user20989@localhost;
|
||||
GRANT SELECT ON table_target TO user20989@localhost;
|
||||
GRANT SELECT ON table_target2 TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON view_target3 TO user20989@localhost;
|
||||
REPLACE INTO table_target
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN table_target AS old
|
||||
USING (mexs_id);
|
||||
ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'table_target'
|
||||
REPLACE INTO view_target2
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'view_target2'
|
||||
REPLACE INTO view_target3
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target3 AS old
|
||||
USING (mexs_id);
|
||||
ERROR HY000: View 'meow.view_target3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
GRANT INSERT,DELETE ON table_target TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON view_target2 TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON table_target3 TO user20989@localhost;
|
||||
REPLACE INTO table_target
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN table_target AS old
|
||||
USING (mexs_id);
|
||||
REPLACE INTO table_target2 VALUES ('00X45Y78','2006-07-12 07:50:00');
|
||||
ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'table_target2'
|
||||
REPLACE INTO view_target2 VALUES ('12X45Y78','2006-07-12 07:50:00');
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
mexs_id messzeit
|
||||
87654321 2006-07-12 07:50:00
|
||||
REPLACE INTO view_target2
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
REPLACE INTO view_target3
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target3 AS old
|
||||
USING (mexs_id);
|
||||
SELECT * FROM table_target;
|
||||
mexs_id messzeit
|
||||
87654321 2006-07-12 07:50:00
|
||||
SELECT * FROM view_target2;
|
||||
mexs_id messzeit
|
||||
12X45Y78 2006-07-12 07:50:00
|
||||
87654321 2006-07-12 07:50:00
|
||||
SELECT * FROM view_target3;
|
||||
mexs_id messzeit
|
||||
87654321 2006-07-12 07:50:00
|
||||
DROP VIEW view_stations;
|
||||
DROP TABLE table_source;
|
||||
DROP TABLE table_countries;
|
||||
DROP TABLE table_stations;
|
||||
DROP TABLE table_target;
|
||||
DROP TABLE table_target2;
|
||||
DROP TABLE table_target3;
|
||||
DROP VIEW view_target2;
|
||||
DROP VIEW view_target3;
|
||||
DROP USER user20989@localhost;
|
||||
DROP DATABASE meow;
|
||||
|
@ -1,6 +1,3 @@
|
||||
# This test should work in embedded server after we fix mysqltest
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
#
|
||||
# This test is a bit tricky as we can't use backup table to overwrite an old
|
||||
# table
|
||||
|
@ -1,11 +1,10 @@
|
||||
# delayed works differently in embedded server
|
||||
--source include/not_embedded.inc
|
||||
#
|
||||
# test of DELAYED insert and timestamps
|
||||
# (Can't be tested with purify :( )
|
||||
#
|
||||
|
||||
# This tests not performed with embedded server
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
@ -1,3 +1,6 @@
|
||||
# In embedded server we don't really have a control over stack usage
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
#
|
||||
# Bug#21476: Lost Database Connection During Query
|
||||
#
|
||||
|
@ -75,24 +75,3 @@ show create database test;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
# FLUSH TABLES WITH READ LOCK should block writes to binlog too
|
||||
connection con1;
|
||||
create table t1 (a int) engine=innodb;
|
||||
reset master;
|
||||
set autocommit=0;
|
||||
insert t1 values (1);
|
||||
connection con2;
|
||||
flush tables with read lock;
|
||||
show master status;
|
||||
connection con1;
|
||||
send commit;
|
||||
connection con2;
|
||||
sleep 1;
|
||||
show master status;
|
||||
unlock tables;
|
||||
connection con1;
|
||||
reap;
|
||||
drop table t1;
|
||||
set autocommit=1;
|
||||
|
||||
|
32
mysql-test/t/flush_block_commit_notembedded.test
Normal file
32
mysql-test/t/flush_block_commit_notembedded.test
Normal file
@ -0,0 +1,32 @@
|
||||
# Let's see if FLUSH TABLES WITH READ LOCK blocks COMMIT of existing
|
||||
# transactions.
|
||||
# We verify that we did not introduce a deadlock.
|
||||
# This is intended to mimick how mysqldump and innobackup work.
|
||||
|
||||
# And it requires InnoDB
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
connect (con2,localhost,root,,);
|
||||
|
||||
# FLUSH TABLES WITH READ LOCK should block writes to binlog too
|
||||
connection con1;
|
||||
create table t1 (a int) engine=innodb;
|
||||
reset master;
|
||||
set autocommit=0;
|
||||
insert t1 values (1);
|
||||
connection con2;
|
||||
flush tables with read lock;
|
||||
show master status;
|
||||
connection con1;
|
||||
send commit;
|
||||
connection con2;
|
||||
sleep 1;
|
||||
show master status;
|
||||
unlock tables;
|
||||
connection con1;
|
||||
reap;
|
||||
drop table t1;
|
||||
set autocommit=1;
|
||||
|
@ -1,3 +1,7 @@
|
||||
# this test mostly test privilege control (what doesn't work
|
||||
# in the embedded server by default). So disabled in embedded-server mode
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
-- source include/testdb_only.inc
|
||||
|
||||
--disable_warnings
|
||||
|
@ -2451,6 +2451,7 @@ drop table t1, t2, t3, t5, t6, t8, t9;
|
||||
|
||||
# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID"
|
||||
--error 1005
|
||||
--replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ /
|
||||
CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
|
||||
|
||||
#
|
||||
|
@ -201,16 +201,6 @@ insert into t1 (b,b) select 1,2;
|
||||
--error 1110
|
||||
INSERT INTO t1 (b,b) SELECT 0,0 ON DUPLICATE KEY UPDATE a = a + VALUES (a);
|
||||
drop table t1;
|
||||
# Test for INSERT DELAYED INTO a <view>
|
||||
# BUG#13683: INSERT DELAYED into a view creates an infinite loop
|
||||
#
|
||||
|
||||
create table t1 (n int);
|
||||
create view v1 as select * from t1;
|
||||
--error 1347
|
||||
insert delayed into v1 values (1);
|
||||
drop table t1;
|
||||
drop view v1;
|
||||
|
||||
#
|
||||
# Test for values returned by ROW_COUNT() function
|
||||
|
154
mysql-test/t/insert_notembedded.test
Normal file
154
mysql-test/t/insert_notembedded.test
Normal file
@ -0,0 +1,154 @@
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
# Test for INSERT DELAYED INTO a <view>
|
||||
# BUG#13683: INSERT DELAYED into a view creates an infinite loop
|
||||
#
|
||||
|
||||
create table t1 (n int);
|
||||
create view v1 as select * from t1;
|
||||
--error 1347
|
||||
insert delayed into v1 values (1);
|
||||
drop table t1;
|
||||
drop view v1;
|
||||
|
||||
#
|
||||
# Bug #20989: View '(null).(null)' references invalid table(s)... on
|
||||
# SQL SECURITY INVOKER
|
||||
#
|
||||
# this is really the fact that REPLACE ... SELECT required additional
|
||||
# INSERT privs (on tables that are part of a view) over the related
|
||||
# REPLACE, SELECT
|
||||
#
|
||||
|
||||
CREATE DATABASE meow;
|
||||
|
||||
connect (root,localhost,root,,meow);
|
||||
connection root;
|
||||
|
||||
CREATE TABLE table_target ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target2 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target3 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE VIEW view_target2 AS SELECT mexs_id,messzeit FROM table_target2;
|
||||
CREATE SQL SECURITY INVOKER VIEW view_target3 AS SELECT mexs_id,messzeit FROM table_target3;
|
||||
|
||||
CREATE TABLE table_stations ( mexs_id VARCHAR(8), icao VARCHAR(4), country CHAR(2), PRIMARY KEY (mexs_id), UNIQUE KEY icao (icao), KEY country (country), CONSTRAINT stations_ibfk_8 FOREIGN KEY (country) REFERENCES countries (country) ON UPDATE CASCADE);
|
||||
INSERT INTO table_stations VALUES ('87654321','XXXX','YY');
|
||||
|
||||
CREATE TABLE table_countries ( country CHAR(2), iso_short_en VARCHAR(64), PRIMARY KEY (country));
|
||||
INSERT INTO table_countries VALUES ('YY','Entenhausen');
|
||||
|
||||
CREATE ALGORITHM=MERGE SQL SECURITY INVOKER VIEW view_stations AS select table_stations.mexs_id AS mexs_id, table_stations.icao AS icao, table_stations.country AS landescode from (table_stations join table_countries on((table_stations.country = table_countries.country)));
|
||||
|
||||
CREATE TABLE table_source ( id varchar(4), datetime TIMESTAMP, PRIMARY KEY (id));
|
||||
INSERT INTO table_source VALUES ('XXXX','2006-07-12 07:50:00');
|
||||
|
||||
GRANT SELECT ON table_source TO user20989@localhost;
|
||||
GRANT SELECT ON table_countries TO user20989@localhost;
|
||||
GRANT SELECT ON table_stations TO user20989@localhost;
|
||||
GRANT SELECT ON view_stations TO user20989@localhost;
|
||||
GRANT SELECT ON table_target TO user20989@localhost;
|
||||
GRANT SELECT ON table_target2 TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON view_target3 TO user20989@localhost;
|
||||
|
||||
connect (user20989,localhost,user20989,,meow);
|
||||
connection user20989;
|
||||
|
||||
--error 1142
|
||||
REPLACE INTO table_target
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN table_target AS old
|
||||
USING (mexs_id);
|
||||
|
||||
--error 1142
|
||||
REPLACE INTO view_target2
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
--error 1356
|
||||
REPLACE INTO view_target3
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target3 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
connection root;
|
||||
disconnect user20989;
|
||||
|
||||
GRANT INSERT,DELETE ON table_target TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON view_target2 TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON table_target3 TO user20989@localhost;
|
||||
|
||||
connect (user20989,localhost,user20989,,meow);
|
||||
connection user20989;
|
||||
|
||||
REPLACE INTO table_target
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN table_target AS old
|
||||
USING (mexs_id);
|
||||
|
||||
--error 1142
|
||||
REPLACE INTO table_target2 VALUES ('00X45Y78','2006-07-12 07:50:00');
|
||||
REPLACE INTO view_target2 VALUES ('12X45Y78','2006-07-12 07:50:00');
|
||||
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
REPLACE INTO view_target2
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
REPLACE INTO view_target3
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target3 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
connection root;
|
||||
disconnect user20989;
|
||||
|
||||
SELECT * FROM table_target;
|
||||
SELECT * FROM view_target2;
|
||||
SELECT * FROM view_target3;
|
||||
|
||||
DROP VIEW view_stations;
|
||||
DROP TABLE table_source;
|
||||
DROP TABLE table_countries;
|
||||
DROP TABLE table_stations;
|
||||
DROP TABLE table_target;
|
||||
DROP TABLE table_target2;
|
||||
DROP TABLE table_target3;
|
||||
DROP VIEW view_target2;
|
||||
DROP VIEW view_target3;
|
||||
DROP USER user20989@localhost;
|
||||
|
||||
disconnect root;
|
||||
|
||||
connection default;
|
||||
|
||||
DROP DATABASE meow;
|
@ -266,140 +266,3 @@ INSERT INTO bug21774_2.t1 SELECT t1.* FROM t1;
|
||||
DROP DATABASE bug21774_1;
|
||||
DROP DATABASE bug21774_2;
|
||||
|
||||
#
|
||||
# Bug #20989: View '(null).(null)' references invalid table(s)... on
|
||||
# SQL SECURITY INVOKER
|
||||
#
|
||||
# this is really the fact that REPLACE ... SELECT required additional
|
||||
# INSERT privs (on tables that are part of a view) over the related
|
||||
# REPLACE, SELECT
|
||||
#
|
||||
|
||||
CREATE DATABASE meow;
|
||||
|
||||
connect (root,localhost,root,,meow);
|
||||
connection root;
|
||||
|
||||
CREATE TABLE table_target ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target2 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target3 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE VIEW view_target2 AS SELECT mexs_id,messzeit FROM table_target2;
|
||||
CREATE SQL SECURITY INVOKER VIEW view_target3 AS SELECT mexs_id,messzeit FROM table_target3;
|
||||
|
||||
CREATE TABLE table_stations ( mexs_id VARCHAR(8), icao VARCHAR(4), country CHAR(2), PRIMARY KEY (mexs_id), UNIQUE KEY icao (icao), KEY country (country), CONSTRAINT stations_ibfk_8 FOREIGN KEY (country) REFERENCES countries (country) ON UPDATE CASCADE);
|
||||
INSERT INTO table_stations VALUES ('87654321','XXXX','YY');
|
||||
|
||||
CREATE TABLE table_countries ( country CHAR(2), iso_short_en VARCHAR(64), PRIMARY KEY (country));
|
||||
INSERT INTO table_countries VALUES ('YY','Entenhausen');
|
||||
|
||||
CREATE ALGORITHM=MERGE SQL SECURITY INVOKER VIEW view_stations AS select table_stations.mexs_id AS mexs_id, table_stations.icao AS icao, table_stations.country AS landescode from (table_stations join table_countries on((table_stations.country = table_countries.country)));
|
||||
|
||||
CREATE TABLE table_source ( id varchar(4), datetime TIMESTAMP, PRIMARY KEY (id));
|
||||
INSERT INTO table_source VALUES ('XXXX','2006-07-12 07:50:00');
|
||||
|
||||
GRANT SELECT ON table_source TO user20989@localhost;
|
||||
GRANT SELECT ON table_countries TO user20989@localhost;
|
||||
GRANT SELECT ON table_stations TO user20989@localhost;
|
||||
GRANT SELECT ON view_stations TO user20989@localhost;
|
||||
GRANT SELECT ON table_target TO user20989@localhost;
|
||||
GRANT SELECT ON table_target2 TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON view_target3 TO user20989@localhost;
|
||||
|
||||
connect (user20989,localhost,user20989,,meow);
|
||||
connection user20989;
|
||||
|
||||
--error 1142
|
||||
REPLACE INTO table_target
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN table_target AS old
|
||||
USING (mexs_id);
|
||||
|
||||
--error 1142
|
||||
REPLACE INTO view_target2
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
--error 1356
|
||||
REPLACE INTO view_target3
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target3 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
connection root;
|
||||
disconnect user20989;
|
||||
|
||||
GRANT INSERT,DELETE ON table_target TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON view_target2 TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON table_target3 TO user20989@localhost;
|
||||
|
||||
connect (user20989,localhost,user20989,,meow);
|
||||
connection user20989;
|
||||
|
||||
REPLACE INTO table_target
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN table_target AS old
|
||||
USING (mexs_id);
|
||||
|
||||
--error 1142
|
||||
REPLACE INTO table_target2 VALUES ('00X45Y78','2006-07-12 07:50:00');
|
||||
REPLACE INTO view_target2 VALUES ('12X45Y78','2006-07-12 07:50:00');
|
||||
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
REPLACE INTO view_target2
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
REPLACE INTO view_target3
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target3 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
connection root;
|
||||
disconnect user20989;
|
||||
|
||||
SELECT * FROM table_target;
|
||||
SELECT * FROM view_target2;
|
||||
SELECT * FROM view_target3;
|
||||
|
||||
DROP VIEW view_stations;
|
||||
DROP TABLE table_source;
|
||||
DROP TABLE table_countries;
|
||||
DROP TABLE table_stations;
|
||||
DROP TABLE table_target;
|
||||
DROP TABLE table_target2;
|
||||
DROP TABLE table_target3;
|
||||
DROP VIEW view_target2;
|
||||
DROP VIEW view_target3;
|
||||
DROP USER user20989@localhost;
|
||||
|
||||
disconnect root;
|
||||
|
||||
connection default;
|
||||
|
||||
DROP DATABASE meow;
|
||||
|
@ -520,6 +520,7 @@ select * from v1a join v1b on t1.b = t2.b;
|
||||
#
|
||||
# Bug #17523 natural join and information_schema
|
||||
#
|
||||
# We mask out the Privileges column because it differs with embedded server
|
||||
--replace_column 31 #
|
||||
select * from information_schema.statistics join information_schema.columns
|
||||
using(table_name,column_name) where table_name='user';
|
||||
|
@ -1,3 +1,6 @@
|
||||
# embedded server causes different stat
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
# PS causes different statistics
|
||||
--disable_ps_protocol
|
||||
|
||||
|
@ -1140,6 +1140,7 @@ select trigger_schema, trigger_name, event_object_schema,
|
||||
# Trick which makes update of second .TRN file impossible
|
||||
system echo dummy >$MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
|
||||
system chmod 000 $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
|
||||
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
|
||||
--error 1
|
||||
rename table t1 to t2;
|
||||
# 't1' should be still there and triggers should work correctly
|
||||
|
@ -3368,7 +3368,11 @@ longlong Item_func_release_lock::val_int()
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef EMBEDDED_LIBRARY
|
||||
if (ull->locked && pthread_equal(current_thd->real_id,ull->thread))
|
||||
#else
|
||||
if (ull->locked && pthread_equal(pthread_self(),ull->thread))
|
||||
#endif
|
||||
{
|
||||
result=1; // Release is ok
|
||||
item_user_lock_release(ull);
|
||||
|
@ -1735,8 +1735,13 @@ bool Item_func_current_user::fix_fields(THD *thd, Item **ref)
|
||||
if (Item_func_sysconst::fix_fields(thd, ref))
|
||||
return TRUE;
|
||||
|
||||
Security_context *ctx= (context->security_ctx
|
||||
Security_context *ctx=
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
(context->security_ctx
|
||||
? context->security_ctx : thd->security_ctx);
|
||||
#else
|
||||
thd->security_ctx;
|
||||
#endif /*NO_EMBEDDED_ACCESS_CHECKS*/
|
||||
return init(ctx->priv_user, ctx->priv_host);
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ ER_CANT_CREATE_TABLE
|
||||
cze "Nemohu vytvo-B<>it tabulku '%-.64s' (chybov<6F> k<>d: %d)"
|
||||
dan "Kan ikke oprette tabellen '%-.64s' (Fejlkode: %d)"
|
||||
nla "Kan tabel '%-.64s' niet aanmaken (Errcode: %d)"
|
||||
eng "Can't create table '%-.64s' (errno: %d)"
|
||||
eng "Can't create table '%-.200s' (errno: %d)"
|
||||
jps "'%-.64s' <20>e<EFBFBD>[<5B>u<EFBFBD><75><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82><EFBFBD>.(errno: %d)",
|
||||
est "Ei suuda luua tabelit '%-.64s' (veakood: %d)"
|
||||
fre "Ne peut cr<63>er la table '%-.64s' (Errcode: %d)"
|
||||
@ -574,7 +574,7 @@ ER_ERROR_ON_RENAME
|
||||
cze "Chyba p-B<>i p<>ejmenov<6F>n<EFBFBD> '%-.64s' na '%-.64s' (chybov<6F> k<>d: %d)"
|
||||
dan "Fejl ved omd<6D>bning af '%-.64s' til '%-.64s' (Fejlkode: %d)"
|
||||
nla "Fout bij het hernoemen van '%-.64s' naar '%-.64s' (Errcode: %d)"
|
||||
eng "Error on rename of '%-.64s' to '%-.64s' (errno: %d)"
|
||||
eng "Error on rename of '%-.150s' to '%-.150s' (errno: %d)"
|
||||
jps "'%-.64s' <20><> '%-.64s' <20><> rename <20>ł<EFBFBD><C582>܂<EFBFBD><DC82><EFBFBD> (errno: %d)",
|
||||
est "Viga faili '%-.64s' <20>mbernimetamisel '%-.64s'-ks (veakood: %d)"
|
||||
fre "Erreur en renommant '%-.64s' en '%-.64s' (Errcode: %d)"
|
||||
|
Reference in New Issue
Block a user