File: keywords.test

package info (click to toggle)
mysql-5.1 5.1.73-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 197,136 kB
  • ctags: 93,377
  • sloc: cpp: 579,952; ansic: 429,462; perl: 49,053; sh: 21,664; pascal: 21,272; yacc: 12,801; makefile: 4,545; xml: 4,114; sql: 3,297; lex: 1,265; asm: 1,023
file content (66 lines) | stat: -rw-r--r-- 1,385 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Test keywords as fields
#

--disable_warnings
drop table if exists t1;
--enable_warnings

create table t1 (time time, date date, timestamp timestamp,
quarter int, week int, year int, timestampadd int, timestampdiff int);
insert into t1 values ("12:22:22","97:02:03","1997-01-02",1,2,3,4,5);
select * from t1;
select t1.time+0,t1.date+0,t1.timestamp+0,concat(date," ",time),
       t1.quarter+t1.week, t1.year+timestampadd,  timestampdiff from t1;
drop table t1;
create table events(binlog int);
insert into events values(1);
select events.binlog from events;
drop table events;

# End of 4.1 tests

#
# Bug#19939 "AUTHORS is not a keyword"
#
delimiter |;
create procedure p1()
begin
   declare n int default 2;
   authors: while n > 0 do
     set n = n -1;
   end while authors;
end|
create procedure p2()
begin
   declare n int default 2;
   contributors: while n > 0 do
     set n = n -1;
   end while contributors;
end|
delimiter ;|
drop procedure p1;
drop procedure p2;

# End of 5.1 tests

#
# Bug#12204 - CONNECTION should not be a reserved word
#

create table t1 (connection int, b int);
delimiter |;
create procedure p1()
begin
  declare connection int;
  select max(t1.connection) into connection from t1;
  select concat("max=",connection) 'p1';
end|
delimiter ;|
insert into t1 (connection) values (1);
call p1();
drop procedure p1;
drop table t1;


# End of 5.0 tests