~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/func_default.result

  • Committer: Brian Aker
  • Date: 2008-11-04 15:39:09 UTC
  • mfrom: (575.1.2 devel)
  • Revision ID: brian@tangent.org-20081104153909-c72hn65udxs1ccal
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
def     NULL    10      3.14
7
7
explain extended select default(str), default(strnull), default(intg), default(rel) from t1;
8
8
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
9
 
1       SIMPLE  t1      system  NULL    NULL    NULL    NULL    1       100.00  
 
9
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    1       100.00  
10
10
Warnings:
11
 
Note    1003    select default('') AS "default(str)",default('') AS "default(strnull)",default('0') AS "default(intg)",default('0') AS "default(rel)" from "test"."t1"
 
11
Note    1003    select default(`test`.`t1`.`str`) AS `default(str)`,default(`test`.`t1`.`strnull`) AS `default(strnull)`,default(`test`.`t1`.`intg`) AS `default(intg)`,default(`test`.`t1`.`rel`) AS `default(rel)` from `test`.`t1`
12
12
select * from t1 where str <> default(str);
13
13
str     strnull intg    rel
14
14
                0       0
15
15
explain select * from t1 where str <> default(str);
16
16
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
17
 
1       SIMPLE  t1      system  NULL    NULL    NULL    NULL    1       
 
17
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    1       Using where
18
18
drop table t1;
19
 
CREATE TABLE t1 (id int(11), s varchar(20));
 
19
CREATE TABLE t1 (id int, s varchar(20));
20
20
INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three');
21
21
SELECT s, 32 AS mi FROM t1 GROUP BY s HAVING DEFAULT(mi) IS NULL;
22
22
ERROR HY000: Field 'mi' doesn't have a default value