· 8 years ago · Dec 11, 2017, 08:26 AM
1(/my/maria-5.3/mysql-test) cat t/skr.test
2#
3# NOTE. Please do not switch connection inside this test.
4# subselect.test is included from several other test cases which set
5# explicit session properties that must be preserved throughout the test.
6# If you need to use a dedicated connection for a test case,
7# close the new connection and switch back to "default" as soon
8# as possible.
9#
10# Initialise
11--disable_warnings
12drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12;
13drop view if exists v2;
14--enable_warnings
15
16#forumconthardwarefr7
17CREATE TABLE `t1` (
18 `numeropost` mediumint(8) unsigned NOT NULL auto_increment,
19 `maxnumrep` int(10) unsigned NOT NULL default '0',
20 PRIMARY KEY (`numeropost`),
21 UNIQUE KEY `maxnumrep` (`maxnumrep`)
22) ENGINE=MyISAM ROW_FORMAT=FIXED;
23
24INSERT INTO t1 (numeropost,maxnumrep) VALUES (1,0),(2,1);
25-- error ER_SUBQUERY_NO_1_ROW
26select numeropost as a FROM t1 ORDER BY (SELECT 1 FROM t1 HAVING a=1);
27drop table t1;