⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.124
Server IP:
50.28.103.30
Server:
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
server
/
mysql
/
mysql-test
/
suite
/
ndb
/
t
/
View File Name :
ndb_fk_locase.test
--source include/have_ndb.inc --disable_query_log CREATE TEMPORARY TABLE IF NOT EXISTS ndb_show_tables_results ( id INT, type VARCHAR(20), state VARCHAR(20), logging VARCHAR(20), _database VARCHAR(255), _schema VARCHAR(20), name VARCHAR(255) ); --enable_query_log select @@global.lower_case_table_names; --echo # test FK name is stored lower case create table T1 ( a int primary key ) engine=ndb; insert into t1 values (1); create table T2 ( a int primary key, b int, foreign key myFK1 (a) references t1 (a), key XB (b) ) engine=ndb; alter table T2 add constraint foreign key MYfk2 (b) references test.t1 (a); show create table t2; --error ER_NO_REFERENCED_ROW_2 insert into t2 values (2,1); --error ER_NO_REFERENCED_ROW_2 insert into t2 values (1,2); --source ndb_show_tables_result.inc select count(*) from ndb_show_tables_results where type = "'UserTable'" and name in ( "'t1'", "'t2'"); select count(*) from ndb_show_tables_results where type = "'ForeignKey'" and name like "'%myfk%'"; alter table T2 drop foreign key MYfk1; alter table t2 drop foreign key myFK2, algorithm=copy; show create table t2; --echo # test upper case parent database and table drop table T2; create table T2 ( a int primary key, b int, foreign key myFK1 (a) references T1 (a), key XB (b) ) engine=ndb; alter table T2 add constraint foreign key MYfk2 (b) references TEST.T1 (a); show create table t2; --error ER_NO_REFERENCED_ROW_2 insert into t2 values (2,1); --error ER_NO_REFERENCED_ROW_2 insert into t2 values (1,2); drop table t2,t1;