mariadb/mysql-test/t/keywords.test
unknown 6a46b6d6e6 Bug#12204
"CONNECTION is a reserved keyword"
  Allow connection to be used as an ordinary identifier
  Tests included.


mysql-test/r/keywords.result:
  test that CONNECTION may be used as ordinary identifier
  test that CONNECTION may be used in stored procedure.
mysql-test/t/keywords.test:
  test that CONNECTION may be used as ordinary identifier
  test that CONNECTION may be used in stored procedure.
sql/sql_yacc.yy:
  Set CONNECTION as an unreserved keyword
2007-02-07 14:22:19 -08:00

43 lines
990 B
Text

#
# 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#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