~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/t/func_default.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--disable_warnings
 
2
drop table if exists t1,t2;
 
3
--enable_warnings
 
4
 
 
5
 
 
6
create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14');
 
7
 
 
8
insert into t1 values ('','',0,0.0);
 
9
select default(str), default(strnull), default(intg), default(rel) from t1;
 
10
explain extended select default(str), default(strnull), default(intg), default(rel) from t1;
 
11
select * from t1 where str <> default(str);
 
12
explain select * from t1 where str <> default(str);
 
13
 
 
14
#TODO: uncomment when bug will be fixed
 
15
#create table t2 select default(str), default(strnull), default(intg), default(rel) from t1;
 
16
#show create table from t1;
 
17
#insert into t2 select select default(str), default(strnull), default(intg), default(rel) from t1;
 
18
 
 
19
drop table t1;
 
20
 
 
21
# End of 4.1 tests
 
22
 
 
23
#
 
24
# Bug #11314 (HAVING DEFAULT() hangs)
 
25
#
 
26
CREATE TABLE t1 (id int(11), s varchar(20));
 
27
INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three');
 
28
--error 1364
 
29
SELECT s, 32 AS mi FROM t1 GROUP BY s HAVING DEFAULT(mi) IS NULL;
 
30
DROP TABLE t1;
 
31