Server IP : 185.86.78.101 / Your IP : 216.73.216.213 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/r/ |
Upload File : |
drop table if exists t1,t2; create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14'); insert into t1 values ('','',0,0.0); select default(str), default(strnull), default(intg), default(rel) from t1; default(str) default(strnull) default(intg) default(rel) def NULL 10 3.14 explain extended select default(str), default(strnull), default(intg), default(rel) from t1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL system NULL NULL NULL NULL 1 100.00 NULL Warnings: Warning 1681 'EXTENDED' is deprecated and will be removed in a future release. Note 1003 /* select#1 */ select default('') AS `default(str)`,default('') AS `default(strnull)`,default('0') AS `default(intg)`,default('0') AS `default(rel)` from dual select * from t1 where str <> default(str); str strnull intg rel 0 0 explain select * from t1 where str <> default(str); id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL system NULL NULL NULL NULL 1 100.00 NULL Warnings: Note 1003 /* select#1 */ select '' AS `str`,'' AS `strnull`,'0' AS `intg`,'0' AS `rel` from dual where ('' <> default('')) drop table t1; CREATE TABLE t1 (id int(11), s varchar(20)); INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three'); SELECT s, 32 AS mi FROM t1 GROUP BY s HAVING DEFAULT(mi) IS NULL; ERROR HY000: Field 'mi' doesn't have a default value DROP TABLE t1;