403Webshell
Server IP : 104.21.38.3  /  Your IP : 162.158.170.92
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 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 : ON
Directory :  /www/server/mysql/src/mysql-test/suite/sysschema/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/sysschema/t/pr_create_synonym_db.test
########### suite/sysschema/t/pr_create_synonym_db.test #############
#                                                                   #
# Testing of of the sys.pr_create_synonym_db() procedure            #
#                                                                   #
# Creation:                                                         #
# 2016-05-23 jkrogh Implement this test as part of bug 22011361     #
#                                                                   #
#####################################################################

-- source include/not_embedded.inc
# Create a couple of tables and a view
CREATE TABLE t1 (t1_id int PRIMARY KEY, t1_val varchar(10));
CREATE TABLE t2 (t2_id int PRIMARY KEY, t1_id int, t2_val int, INDEX (t1_id));
CREATE TABLE `is` (t1_id int PRIMARY KEY, t1_val varchar(10));
CREATE TABLE `ab``c` (t1_id int PRIMARY KEY, t1_val varchar(10));
CREATE SQL SECURITY INVOKER VIEW myview AS SELECT * FROM t1 NATURAL JOIN t2;

# Make synonym db of test into test1
CALL sys.create_synonym_db('test', 'test1');
# Verify there's one view in test1 per table and view in test
SELECT TABLE_NAME, SECURITY_TYPE FROM information_schema.VIEWS WHERE TABLE_SCHEMA = 'test1' ORDER BY TABLE_NAME;
# Try again (should fail)
-- error ER_SIGNAL_EXCEPTION
CALL sys.create_synonym_db('test', 'test1');

# Try to make the synonym db for an existing empty schema
CREATE SCHEMA test2;
-- error ER_SIGNAL_EXCEPTION
CALL sys.create_synonym_db('test', 'test2');
# Ensure test2 is still empty
SELECT COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'test2';

# Use a reserved identifer, Bug #22011361
CALL sys.create_synonym_db('test', 'is');
# Verify there's one view in is per table and view in test
SELECT TABLE_NAME, SECURITY_TYPE FROM information_schema.VIEWS WHERE TABLE_SCHEMA = 'is' ORDER BY TABLE_NAME;

# Copy the is schema to i`s schema:
CALL sys.create_synonym_db('is', 'i`s');
# Verify there's one view in i`s per table and view in is
SELECT TABLE_NAME, SECURITY_TYPE FROM information_schema.VIEWS WHERE TABLE_SCHEMA = 'i`s' ORDER BY TABLE_NAME;

# Clean up
DROP SCHEMA test1;
DROP SCHEMA test2;
DROP SCHEMA `is`;
DROP SCHEMA `i``s`;
DROP VIEW test.myview;
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE `is`;
DROP TABLE `ab``c`;

Youez - 2016 - github.com/yon3zu
LinuXploit