~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
#
2
# This file contains tests covering the parser
3
#
4
5
#=============================================================================
6
# LEXICAL PARSER (lex)
7
#=============================================================================
8
9
#
10
# Documenting the current behavior, to detect incompatible changes.
11
# In each cases:
12
# - no error is the correct result
13
# - an error is the expected result with the current implementation,
14
#   and is a limitation.
15
16
create table ADDDATE(a int);
17
drop table ADDDATE;
18
create table ADDDATE (a int);
19
drop table ADDDATE;
20
21
--error ER_PARSE_ERROR
22
create table CAST(a int);
520.1.8 by Brian Aker
Updating tests.
23
--error ER_PARSE_ERROR
1 by brian
clean slate
24
create table CAST (a int);
25
26
--error ER_PARSE_ERROR
27
create table COUNT(a int);
520.1.8 by Brian Aker
Updating tests.
28
--error ER_PARSE_ERROR
1 by brian
clean slate
29
create table COUNT (a int);
30
31
--error ER_PARSE_ERROR
32
create table CURDATE(a int);
520.1.8 by Brian Aker
Updating tests.
33
--error ER_PARSE_ERROR
1 by brian
clean slate
34
create table CURDATE (a int);
35
36
--error ER_PARSE_ERROR
37
create table CURTIME(a int);
520.1.8 by Brian Aker
Updating tests.
38
--error ER_PARSE_ERROR
1 by brian
clean slate
39
create table CURTIME (a int);
40
41
--error ER_PARSE_ERROR
42
create table DATE_ADD(a int);
520.1.8 by Brian Aker
Updating tests.
43
--error ER_PARSE_ERROR
1 by brian
clean slate
44
create table DATE_ADD (a int);
45
46
--error ER_PARSE_ERROR
47
create table DATE_SUB(a int);
520.1.8 by Brian Aker
Updating tests.
48
--error ER_PARSE_ERROR
1 by brian
clean slate
49
create table DATE_SUB (a int);
50
51
--error ER_PARSE_ERROR
52
create table EXTRACT(a int);
520.1.8 by Brian Aker
Updating tests.
53
--error ER_PARSE_ERROR
1 by brian
clean slate
54
create table EXTRACT (a int);
55
56
--error ER_PARSE_ERROR
57
create table GROUP_CONCAT(a int);
520.1.8 by Brian Aker
Updating tests.
58
--error ER_PARSE_ERROR
1 by brian
clean slate
59
create table GROUP_CONCAT (a int);
60
61
# Limitation removed in 5.1
62
create table GROUP_UNIQUE_USERS(a int);
63
drop table GROUP_UNIQUE_USERS;
64
create table GROUP_UNIQUE_USERS (a int);
65
drop table GROUP_UNIQUE_USERS;
66
67
--error ER_PARSE_ERROR
68
create table MAX(a int);
520.1.8 by Brian Aker
Updating tests.
69
--error ER_PARSE_ERROR
1 by brian
clean slate
70
create table MAX (a int);
71
72
--error ER_PARSE_ERROR
73
create table MID(a int);
520.1.8 by Brian Aker
Updating tests.
74
--error ER_PARSE_ERROR
1 by brian
clean slate
75
create table MID (a int);
76
77
--error ER_PARSE_ERROR
78
create table MIN(a int);
520.1.8 by Brian Aker
Updating tests.
79
--error ER_PARSE_ERROR
1 by brian
clean slate
80
create table MIN (a int);
81
82
--error ER_PARSE_ERROR
83
create table NOW(a int);
520.1.8 by Brian Aker
Updating tests.
84
--error ER_PARSE_ERROR
1 by brian
clean slate
85
create table NOW (a int);
86
87
--error ER_PARSE_ERROR
88
create table POSITION(a int);
520.1.8 by Brian Aker
Updating tests.
89
--error ER_PARSE_ERROR
1 by brian
clean slate
90
create table POSITION (a int);
91
92
create table SESSION_USER(a int);
93
drop table SESSION_USER;
94
create table SESSION_USER (a int);
95
drop table SESSION_USER;
96
97
--error ER_PARSE_ERROR
98
create table STD(a int);
520.1.8 by Brian Aker
Updating tests.
99
--error ER_PARSE_ERROR
1 by brian
clean slate
100
create table STD (a int);
101
102
--error ER_PARSE_ERROR
103
create table STDDEV(a int);
520.1.8 by Brian Aker
Updating tests.
104
--error ER_PARSE_ERROR
1 by brian
clean slate
105
create table STDDEV (a int);
106
107
--error ER_PARSE_ERROR
108
create table STDDEV_POP(a int);
520.1.8 by Brian Aker
Updating tests.
109
--error ER_PARSE_ERROR
1 by brian
clean slate
110
create table STDDEV_POP (a int);
111
112
--error ER_PARSE_ERROR
113
create table STDDEV_SAMP(a int);
520.1.8 by Brian Aker
Updating tests.
114
--error ER_PARSE_ERROR
1 by brian
clean slate
115
create table STDDEV_SAMP (a int);
116
117
create table SUBDATE(a int);
118
drop table SUBDATE;
119
create table SUBDATE (a int);
120
drop table SUBDATE;
121
122
--error ER_PARSE_ERROR
123
create table SUBSTR(a int);
520.1.8 by Brian Aker
Updating tests.
124
--error ER_PARSE_ERROR
1 by brian
clean slate
125
create table SUBSTR (a int);
126
127
--error ER_PARSE_ERROR
128
create table SUM(a int);
520.1.8 by Brian Aker
Updating tests.
129
--error ER_PARSE_ERROR
1 by brian
clean slate
130
create table SUM (a int);
131
132
--error ER_PARSE_ERROR
133
create table SYSDATE(a int);
520.1.8 by Brian Aker
Updating tests.
134
--error ER_PARSE_ERROR
1 by brian
clean slate
135
create table SYSDATE (a int);
136
137
create table SYSTEM_USER(a int);
138
drop table SYSTEM_USER;
139
create table SYSTEM_USER (a int);
140
drop table SYSTEM_USER;
141
142
--error ER_PARSE_ERROR
143
create table TRIM(a int);
520.1.8 by Brian Aker
Updating tests.
144
--error ER_PARSE_ERROR
1 by brian
clean slate
145
create table TRIM (a int);
146
147
# Limitation removed in 5.1
148
create table UNIQUE_USERS(a int);
149
drop table UNIQUE_USERS;
150
create table UNIQUE_USERS (a int);
151
drop table UNIQUE_USERS;
152
153
--error ER_PARSE_ERROR
154
create table VARIANCE(a int);
520.1.8 by Brian Aker
Updating tests.
155
--error ER_PARSE_ERROR
1 by brian
clean slate
156
create table VARIANCE (a int);
157
158
--error ER_PARSE_ERROR
159
create table VAR_POP(a int);
520.1.8 by Brian Aker
Updating tests.
160
--error ER_PARSE_ERROR
1 by brian
clean slate
161
create table VAR_POP (a int);
162
163
--error ER_PARSE_ERROR
164
create table VAR_SAMP(a int);
520.1.8 by Brian Aker
Updating tests.
165
--error ER_PARSE_ERROR
1 by brian
clean slate
166
create table VAR_SAMP (a int);
167
168
create table ADDDATE(a int);
169
drop table ADDDATE;
170
create table ADDDATE (a int);
171
drop table ADDDATE;
172
173
--error ER_PARSE_ERROR
174
create table CAST(a int);
175
--error ER_PARSE_ERROR
176
create table CAST (a int);
177
178
--error ER_PARSE_ERROR
179
create table COUNT(a int);
180
--error ER_PARSE_ERROR
181
create table COUNT (a int);
182
183
--error ER_PARSE_ERROR
184
create table CURDATE(a int);
185
--error ER_PARSE_ERROR
186
create table CURDATE (a int);
187
188
--error ER_PARSE_ERROR
189
create table CURTIME(a int);
190
--error ER_PARSE_ERROR
191
create table CURTIME (a int);
192
193
--error ER_PARSE_ERROR
194
create table DATE_ADD(a int);
195
--error ER_PARSE_ERROR
196
create table DATE_ADD (a int);
197
198
--error ER_PARSE_ERROR
199
create table DATE_SUB(a int);
200
--error ER_PARSE_ERROR
201
create table DATE_SUB (a int);
202
203
--error ER_PARSE_ERROR
204
create table EXTRACT(a int);
205
--error ER_PARSE_ERROR
206
create table EXTRACT (a int);
207
208
--error ER_PARSE_ERROR
209
create table GROUP_CONCAT(a int);
210
--error ER_PARSE_ERROR
211
create table GROUP_CONCAT (a int);
212
213
# Limitation removed in 5.1
214
create table GROUP_UNIQUE_USERS(a int);
215
drop table GROUP_UNIQUE_USERS;
216
create table GROUP_UNIQUE_USERS (a int);
217
drop table GROUP_UNIQUE_USERS;
218
219
--error ER_PARSE_ERROR
220
create table MAX(a int);
221
--error ER_PARSE_ERROR
222
create table MAX (a int);
223
224
--error ER_PARSE_ERROR
225
create table MID(a int);
226
--error ER_PARSE_ERROR
227
create table MID (a int);
228
229
--error ER_PARSE_ERROR
230
create table MIN(a int);
231
--error ER_PARSE_ERROR
232
create table MIN (a int);
233
234
--error ER_PARSE_ERROR
235
create table NOW(a int);
236
--error ER_PARSE_ERROR
237
create table NOW (a int);
238
239
--error ER_PARSE_ERROR
240
create table POSITION(a int);
241
--error ER_PARSE_ERROR
242
create table POSITION (a int);
243
244
create table SESSION_USER(a int);
245
drop table SESSION_USER;
246
create table SESSION_USER (a int);
247
drop table SESSION_USER;
248
249
--error ER_PARSE_ERROR
250
create table STD(a int);
251
--error ER_PARSE_ERROR
252
create table STD (a int);
253
254
--error ER_PARSE_ERROR
255
create table STDDEV(a int);
256
--error ER_PARSE_ERROR
257
create table STDDEV (a int);
258
259
--error ER_PARSE_ERROR
260
create table STDDEV_POP(a int);
261
--error ER_PARSE_ERROR
262
create table STDDEV_POP (a int);
263
264
--error ER_PARSE_ERROR
265
create table STDDEV_SAMP(a int);
266
--error ER_PARSE_ERROR
267
create table STDDEV_SAMP (a int);
268
269
create table SUBDATE(a int);
270
drop table SUBDATE;
271
create table SUBDATE (a int);
272
drop table SUBDATE;
273
274
--error ER_PARSE_ERROR
275
create table SUBSTR(a int);
276
--error ER_PARSE_ERROR
277
create table SUBSTR (a int);
278
279
--error ER_PARSE_ERROR
280
create table SUBSTRING(a int);
281
--error ER_PARSE_ERROR
282
create table SUBSTRING (a int);
283
284
--error ER_PARSE_ERROR
285
create table SUM(a int);
286
--error ER_PARSE_ERROR
287
create table SUM (a int);
288
289
--error ER_PARSE_ERROR
290
create table SYSDATE(a int);
291
--error ER_PARSE_ERROR
292
create table SYSDATE (a int);
293
294
create table SYSTEM_USER(a int);
295
drop table SYSTEM_USER;
296
create table SYSTEM_USER (a int);
297
drop table SYSTEM_USER;
298
299
--error ER_PARSE_ERROR
300
create table TRIM(a int);
301
--error ER_PARSE_ERROR
302
create table TRIM (a int);
303
304
# Limitation removed in 5.1
305
create table UNIQUE_USERS(a int);
306
drop table UNIQUE_USERS;
307
create table UNIQUE_USERS (a int);
308
drop table UNIQUE_USERS;
309
310
--error ER_PARSE_ERROR
311
create table VARIANCE(a int);
312
--error ER_PARSE_ERROR
313
create table VARIANCE (a int);
314
315
--error ER_PARSE_ERROR
316
create table VAR_POP(a int);
317
--error ER_PARSE_ERROR
318
create table VAR_POP (a int);
319
320
--error ER_PARSE_ERROR
321
create table VAR_SAMP(a int);
322
--error ER_PARSE_ERROR
323
create table VAR_SAMP (a int);
324
325
#
326
# Bug#25930 (CREATE TABLE x SELECT ... parses columns wrong when ran with
327
#            ANSI_QUOTES mode)
328
#
329
330
--disable_warnings
331
DROP TABLE IF EXISTS table_25930_a;
332
DROP TABLE IF EXISTS table_25930_b;
333
--enable_warnings
334
520.1.8 by Brian Aker
Updating tests.
335
--error ER_PARSE_ERROR
1 by brian
clean slate
336
CREATE TABLE table_25930_a ( "blah" INT );
520.1.8 by Brian Aker
Updating tests.
337
CREATE TABLE table_25930_a ( blah INT );
1 by brian
clean slate
338
CREATE TABLE table_25930_b SELECT "blah" - 1 FROM table_25930_a;
339
340
# The lexer used to chop the first <">,
341
# not marking the start of the token "blah" correctly.
342
desc table_25930_b;
343
344
DROP TABLE table_25930_a;
345
DROP TABLE table_25930_b;
346
347
348
#=============================================================================
349
# SYNTACTIC PARSER (bison)
350
#=============================================================================
351
352
#
353
#
354
# Bug#21114 (Foreign key creation fails to table with name format)
355
# 
356
357
# Test coverage with edge conditions
358
359
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
360
select pi(3.14);
361
362
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
363
select tan();
364
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
365
select tan(1, 2);
366
367
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
368
select makedate(1);
369
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
370
select makedate(1, 2, 3);
371
372
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
373
select maketime();
374
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
375
select maketime(1);
376
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
377
select maketime(1, 2);
378
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
379
select maketime(1, 2, 3, 4);
380
381
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
382
select atan();
383
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
384
select atan2(1, 2, 3);
385
386
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
387
select concat();
388
select concat("foo");
389
390
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
391
select concat_ws();
392
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
393
select concat_ws("foo");
394
395
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
396
select elt();
397
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
398
select elt(1);
399
400
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
401
select export_set();
402
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
403
select export_set("p1");
404
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
405
select export_set("p1", "p2");
406
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
407
select export_set("p1", "p2", "p3", "p4", "p5", "p6");
408
409
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
410
select field();
411
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
412
select field("p1");
413
414
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
415
select from_unixtime();
416
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
417
select from_unixtime(1, 2, 3);
418
419
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
420
select unix_timestamp(1, 2);
421
422
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
423
select greatest();
424
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
425
select greatest(12);
426
427
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
428
select last_insert_id(1, 2);
429
430
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
431
select least();
432
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
433
select least(12);
434
435
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
436
select locate();
437
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
438
select locate(1);
439
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
440
select locate(1, 2, 3, 4);
441
442
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
443
select log();
444
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
445
select log(1, 2, 3);
446
447
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
448
select make_set();
449
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
450
select make_set(1);
451
452
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
453
select master_pos_wait();
454
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
455
select master_pos_wait(1);
456
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
457
select master_pos_wait(1, 2, 3, 4);
458
459
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
460
select rand(1, 2, 3);
461
462
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
463
select round(1, 2, 3);
464
465
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
466
select yearweek();
467
-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
468
select yearweek(1, 2, 3);
469
470
#
471
# Bug#24736: UDF functions parsed as Stored Functions
472
#
473
474
# Verify that the syntax for calling UDF : foo(expr AS param, ...)
475
# can not be used when calling native functions
476
477
# Native function with 1 argument
478
479
select abs(3);
480
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
481
select abs(3 AS three);
482
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
483
select abs(3 three);
484
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
485
select abs(3 AS "three");
486
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
487
select abs(3 "three");
488
489
# Native function with 2 arguments
490
491
set @bar="bar";
492
set @foobar="foobar";
493
494
select instr("foobar", "bar");
495
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
496
select instr("foobar" AS p1, "bar");
497
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
498
select instr("foobar" p1, "bar");
499
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
500
select instr("foobar" AS "p1", "bar");
501
## String concatenation, valid syntax
502
select instr("foobar" "p1", "bar");
503
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
504
select instr(@foobar "p1", "bar");
505
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
506
select instr("foobar", "bar" AS p2);
507
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
508
select instr("foobar", "bar" p2);
509
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
510
select instr("foobar", "bar" AS "p2");
511
## String concatenation, valid syntax
512
select instr("foobar", "bar" "p2");
513
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
514
select instr("foobar", @bar "p2");
515
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
516
select instr("foobar" AS p1, "bar" AS p2);
517
518
# Native function with 3 arguments
519
520
select conv(255, 10, 16);
521
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
522
select conv(255 AS p1, 10, 16);
523
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
524
select conv(255 p1, 10, 16);
525
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
526
select conv(255 AS "p1", 10, 16);
527
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
528
select conv(255 "p1", 10, 16);
529
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
530
select conv(255, 10 AS p2, 16);
531
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
532
select conv(255, 10 p2, 16);
533
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
534
select conv(255, 10 AS "p2", 16);
535
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
536
select conv(255, 10 "p2", 16);
537
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
538
select conv(255, 10, 16 AS p3);
539
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
540
select conv(255, 10, 16 p3);
541
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
542
select conv(255, 10, 16 AS "p3");
543
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
544
select conv(255, 10, 16 "p3");
545
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
546
select conv(255 AS p1, 10 AS p2, 16 AS p3);
547
548
# Native function with a variable number of arguments
549
550
# Bug in libm.so on Solaris:
551
#   atan(10) from 32-bit version returns 1.4711276743037347
552
#   atan(10) from 64-bit version returns 1.4711276743037345
553
--replace_result 1.4711276743037345 1.4711276743037347
554
select atan(10);
555
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
556
select atan(10 AS p1);
557
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
558
select atan(10 p1);
559
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
560
select atan(10 AS "p1");
561
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
562
select atan(10 "p1");
563
564
select atan(10, 20);
565
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
566
select atan(10 AS p1, 20);
567
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
568
select atan(10 p1, 20);
569
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
570
select atan(10 AS "p1", 20);
571
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
572
select atan(10 "p1", 20);
573
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
574
select atan(10, 20 AS p2);
575
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
576
select atan(10, 20 p2);
577
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
578
select atan(10, 20 AS "p2");
579
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
580
select atan(10, 20 "p2");
581
-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
582
select atan(10 AS p1, 20 AS p2);
583
584
#
585
# Bug#22312 Syntax error in expression with INTERVAL()
586
#
587
588
--disable_warnings
589
DROP TABLE IF EXISTS t1;
590
--enable_warnings
591
592
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
593
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE;
594
SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND;
595
SELECT 1 + INTERVAL(1,0,1,2) + 1;
520.1.8 by Brian Aker
Updating tests.
596
SELECT INTERVAL(1,0,1,2) + 1;
1 by brian
clean slate
597
SELECT INTERVAL(1,0+1,2,3) * 5.5;
598
SELECT INTERVAL(3,3,1+3,4+4) / 0.5;
599
SELECT (INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2;
600
SELECT INTERVAL(1,0,1,2) + 1, 5 * INTERVAL(1,0,1,2);
601
SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3);
602
603
CREATE TABLE t1 (a INT, b DATETIME);
604
INSERT INTO t1 VALUES (INTERVAL(3,2,1) + 1, "1997-12-31 23:59:59" + INTERVAL 1 SECOND);
605
SELECT * FROM t1 WHERE a = INTERVAL(3,2,1) + 1;
606
DROP TABLE t1;
607
608
#
609
# Bug#28317 Left Outer Join with {oj outer-join}
610
#
611
612
--disable_warnings
613
DROP TABLE IF EXISTS t1,t2,t3;
614
--enable_warnings
615
CREATE TABLE t1 (a1 INT, a2 INT, a3 INT, a4 DATETIME);
616
CREATE TABLE t2 LIKE t1;
617
CREATE TABLE t3 LIKE t1;
618
SELECT t1.* FROM t1 AS t0, { OJ t2 INNER JOIN t1 ON (t1.a1=t2.a1) } WHERE t0.a3=2;
619
SELECT t1.*,t2.* FROM { OJ ((t1 INNER JOIN t2 ON (t1.a1=t2.a2)) LEFT OUTER JOIN t3 ON t3.a3=t2.a1)};
620
SELECT t1.*,t2.* FROM { OJ ((t1 LEFT OUTER JOIN t2 ON t1.a3=t2.a2) INNER JOIN t3 ON (t3.a1=t2.a2))};
621
SELECT t1.*,t2.* FROM { OJ (t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a2) CROSS JOIN t3 ON (t3.a2=t2.a3)};
622
SELECT * FROM {oj t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a3} WHERE t1.a2 > 10;
623
SELECT {fn CONCAT(a1,a2)} FROM t1;
624
UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0;
625
SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')};
626
DROP TABLE t1, t2, t3;
627
628
#
629
# Bug#31765 (BACKUP DATABASE broken syntax)
630
#
631
632
--error ER_PARSE_ERROR
633
BACKUP DATABASE *, test to 'broken.bak';
634
635
--error ER_PARSE_ERROR
636
BACKUP DATABASE *, db1, db2, db3 to 'broken.bak';
637