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

« back to all changes in this revision

Viewing changes to mysql-test/t/comments.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
#
 
2
# Testing of comments
 
3
#
 
4
 
 
5
select 1+2/*hello*/+3;
 
6
select 1 /* long
 
7
multi line comment */;
 
8
--error 1065
 
9
 ;
 
10
select 1 /*!32301 +1 */;
 
11
select 1 /*!52301 +1 */;
 
12
select 1--1;
 
13
# Note that the following returns 4 while it should return 2
 
14
# This is because the mysqld server doesn't parse -- comments
 
15
select 1 --2
 
16
+1;
 
17
select 1 # The rest of the row will be ignored
 
18
;
 
19
/* line with only comment */;
 
20
 
 
21
# End of 4.1 tests
 
22
 
 
23
#
 
24
# Bug#25411 (trigger code truncated)
 
25
#
 
26
 
 
27
--error ER_PARSE_ERROR
 
28
select 1/*!2*/;
 
29
 
 
30
--error ER_PARSE_ERROR
 
31
select 1/*!000002*/;
 
32
 
 
33
select 1/*!999992*/;
 
34
 
 
35
select 1 + /*!00000 2 */ + 3 /*!99999 noise*/ + 4;
 
36
 
 
37
#
 
38
# Bug#28779 (mysql_query() allows execution of statements with unbalanced
 
39
# comments)
 
40
#
 
41
 
 
42
--disable_warnings
 
43
drop table if exists table_28779;
 
44
--enable_warnings
 
45
 
 
46
create table table_28779 (a int);
 
47
 
 
48
--error 1064
 
49
prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*' AND b = 'bar';";
 
50
 
 
51
--error 1064
 
52
prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*' AND b = 'bar';*";
 
53
 
 
54
--error 1064
 
55
prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*! AND 2=2;";
 
56
 
 
57
--error 1064
 
58
prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*! AND 2=2;*";
 
59
 
 
60
--error 1064
 
61
prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*!98765' AND b = 'bar';";
 
62
 
 
63
--error 1064
 
64
prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*!98765' AND b = 'bar';*";
 
65
 
 
66
drop table table_28779;
 
67