Server IP : 185.86.78.101 / Your IP : 216.73.216.124 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/server/mysql/mysql-test/t/ |
Upload File : |
# The include statement below is a temp one for tests that are yet to #be ported to run with InnoDB, #but needs to be kept for tests that would need MyISAM in future. --source include/force_myisam_default.inc -- source include/not_embedded.inc --disable_warnings drop table if exists t1; --enable_warnings # # 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'); SET @orig_sql_mode= @@sql_mode; SET sql_mode= (select replace(@@sql_mode,'NO_AUTO_CREATE_USER','')); GRANT SELECT ON table_source TO user20989@localhost; SET sql_mode= @orig_sql_mode; 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;