Warning, /libraries/kdb/autotests/parser/data/statements.txt is written in an unsupported language. File is not indexed.

0001 -- This file is part of the KDE project
0002 -- Copyright (C) 2012 Jarosław Staniek <staniek@kde.org>
0003 --
0004 -- This library is free software; you can redistribute it and/or
0005 -- modify it under the terms of the GNU Library General Public
0006 -- License as published by the Free Software Foundation; either
0007 -- version 2 of the License, or (at your option) any later version.
0008 --
0009 -- This library is distributed in the hope that it will be useful,
0010 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
0011 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012 -- Library General Public License for more details.
0013 --
0014 -- You should have received a copy of the GNU Library General Public License
0015 -- along with this library; see the file COPYING.LIB.  If not, write to
0016 -- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017 -- Boston, MA 02110-1301, USA.
0018 
0019 -- SQLITEFILE: sqlParserTest.kexi --
0020 
0021 ---------- CATEGORY: General --------------
0022 -- The same field used in two columns
0023 select id, id from persons;
0024 -- No args: OK
0025 select;
0026 -- Whitespace between table-identifier, dot field-identifier/asterisk
0027 select persons .  id from persons;
0028 select persons .        * from persons;
0029 -- ERROR: Multiple asterisks
0030 select *, * from persons;
0031 -- ERROR: Identifier cannot start with a number
0032 select 1id from persons;
0033 -- ERROR: Asterisk not allowed: no tables specified
0034 select *;
0035 -- Empty tables set
0036 select 1, 2;
0037 -- Empty column set (KDbSQL EXTENSION)
0038 select from cars;
0039 -- Totally empty statement (KDbSQL EXTENSION)
0040 select;
0041 -- Keywords and constants are case insensitive
0042 SElEcT * FroM cars;
0043 select TRue;
0044 select FaLse;
0045 selecT FALse oR TRuE;
0046 selecT 1 LIKe 1;
0047 -- Constants
0048 select -12;
0049 select 7777777;
0050 select -1048576;
0051 select 16777216;
0052 select "01234567890";
0053 select '01234567890';
0054 select '"';
0055 select '\\';
0056 select '\"';
0057 select 3.14159;
0058 select 3.;
0059 select NULL;
0060 -- Date Constants (KDbSQL EXTENSION)
0061 -- https://community.kde.org/Kexi/Plugins/Queries/SQL_Constants
0062 -- Date Constants: AD
0063 select #2018-09-17#;
0064 select #09/17/2018#;
0065 select #2018-9-17#;
0066 select #9/17/2018#;
0067 select #2018-9-07#;
0068 select #9/07/2018#;
0069 select #2018-9-7#;
0070 select #9/7/2018#;
0071 select #2018-09-7#;
0072 select #09/7/2018#;
0073 select #1900-01-01#;
0074 select #01/01/1900#;
0075 select #1500-02-02#;
0076 select #02/02/1500#;
0077 select #0001-01-21#;
0078 select #01/21/0001#;
0079 -- ERROR: Date Constants: Invalid month
0080 select #2018-00-17#;
0081 select #00/17/2018#;
0082 select #2018-0-17#;
0083 select #0/17/2018#;
0084 select #2018-13-17#;
0085 select #13/17/2018#;
0086 select #2018-99-17#;
0087 select #99/17/2018#;
0088 -- ERROR: Date Constants: Invalid day
0089 select #2018-01-00#;
0090 select #01/00/2018#;
0091 select #2018-01-0#;
0092 select #01/0/2018#;
0093 select #2018-02-29#;
0094 select #02/29/2018#;
0095 select #2018-01-32#;
0096 select #01/32/2018#;
0097 -- ERROR: Date Constants: too many digits
0098 select #2018-001-30#;
0099 select #001/30/2018#;
0100 select #2018-001-030#;
0101 select #001/030/2018#;
0102 select #2018-01-030#;
0103 select #01/030/2018#;
0104 -- ERROR: Date Constants: invalid characters/format
0105 select #2018-1a-30#;
0106 select #1a/30/2018#;
0107 select #2018--30#;
0108 select #/30/2018#;
0109 select #2018-a-30#;
0110 select #a/30/2018#;
0111 select #2018-01-3o#;
0112 select #01/3o/2018#;
0113 select #2018-01-30;
0114 select #01/30/2018;
0115 select #2018_01-30#;
0116 select #01/30_2018#;
0117 select #2018-01_30;
0118 select #01_30/2018#;
0119 select #2018_01_30;
0120 select #2018-01/30;
0121 select #20180130;
0122 select #2018;
0123 select #2018-;
0124 select #2018/;
0125 select #/2018;
0126 select #2018-01;
0127 select #01/2018;
0128 select #2018-01-;
0129 select #/01/2018;
0130 select #2018/01;
0131 select #-2018-01-;
0132 select #/01/2018;
0133 select #-2018;
0134 select ##-2018;
0135 select ##/2018;
0136 select #;
0137 select ##;
0138 select #2018-01-01-01#;
0139 select #01/01/01/2018#;
0140 select #++18119-10-30#;
0141 select #10/30/++18119#;
0142 select #+-18119-10-30#;
0143 select #10/30/+-18119#;
0144 select #-+18119-10-30#;
0145 select #10/30/-+18119#;
0146 select #--18119-10-30#;
0147 select #10/30/--18119#;
0148 select # 2018-03-08#;
0149 select #2018-03-08 #;
0150 select # 2018-03-08 #;
0151 select # 2018 -03-08 #;
0152 select #2018-03 -08#;
0153 select #2018 - 03 - 08#;
0154 select #201 -03-08 #;
0155 select #2018- 3-08 #;
0156 select #2018-03- 8 #;
0157 -- ERROR: Date Constant: at least 4 digit year required
0158 select #189-12-13#;
0159 select #12/13/189#;
0160 -- Date Constants: optional "+" prefix for years 1-9999
0161 select #+2018-12-02#;
0162 select #12/02/+2018#;
0163 select #+1500-02-02#;
0164 select #12/02/+1500#;
0165 select #+1500-3-2#;
0166 select #3/02/+1500#;
0167 select #+02012-12-13#;
0168 select #12/13/+02012#;
0169 -- Date Constants, year > 9999
0170 select #+123456789-12-13#;
0171 select #12/13/+123456789#;
0172 select #+000123456789-12-13#;
0173 select #12/13/+000123456789#;
0174 -- ERROR: Date Constant: More than 4-digit year so "+" prefix is required
0175 select #123456789-12-13#;
0176 select #12/13/123456789#;
0177 -- 1 BC Date Constants
0178 select #+0000-01-30#;
0179 select #01/30/+0000#;
0180 -- ERROR: Date Constant: 1 BC requires +0000 year
0181 select #0000-01-01#;
0182 select #01/01/0000#;
0183 select #-0000-01-01#;
0184 select #01/01/-0000#;
0185 select #+000-01-01#;
0186 select #01/01/+000#;
0187 select #-000-01-01#;
0188 select #01/01/-000#;
0189 select #+00-01-01#;
0190 select #01/01/+00#;
0191 select #-00-01-01#;
0192 select #01/01/-00#;
0193 select #+0-01-01#;
0194 select #01/01/+0#;
0195 select #-0-01-01#;
0196 select #01/01/-0#;
0197 -- 2 BC Date Constants
0198 select #-0001-03-04#;
0199 select #03/04/-0001#;
0200 select #-5001-03-04#;
0201 select #03/04/-5001#;
0202 -- <= 10000 BC Date Constants
0203 select #-9999-03-04#;
0204 select #04/03/-9999#;
0205 select #-10000-03-04#;
0206 select #04/03/-10000#;
0207 select #-543210000-03-04#;
0208 select #04/03/-543210000#;
0209 select #-00543210000-03-04#;
0210 select #04/03/-00543210000#;
0211 -- ERROR: Date Constant: MSA format
0212 select #24 Dec 2014#;
0213 select #24 December 2014#;
0214 select #December 24, 2014#;
0215 select #Dec 24, 2014#;
0216 
0217 -- Time Constants (KDbSQL EXTENSION)
0218 -- https://community.kde.org/Kexi/Plugins/Queries/SQL_Constants
0219 -- Time Constants: 24h mode
0220 select #01:17:59#;
0221 select #01:07:59#;
0222 select #01:07:09#;
0223 select #1:07:09#;
0224 select #01:7:09#;
0225 select #01:07:9#;
0226 select #01:7:9#;
0227 select #1:7:09#;
0228 select #1:07:9#;
0229 select #1:7:9#;
0230 select #0:0:0#;
0231 select #23:11:29#;
0232 select #13:17:59#;
0233 select #23:11#;
0234 select #03:01#;
0235 select #3:01#;
0236 select #03:1#;
0237 select #3:1#;
0238 -- Time Constants: 12h mode
0239 select #11:11:29 AM#;
0240 select #11:11:29 PM#;
0241 select #11:11:29AM#;
0242 select #11:11:29PM#;
0243 select #11:11:29am#;
0244 select #11:11:29pm#;
0245 select #11:11:29   AM#;
0246 select #11:11:29   PM#;
0247 select #1:31:19 aM#;
0248 select #1:31:19 Am#;
0249 select #1:31:19 am#;
0250 select #1:31:19 pM#;
0251 select #1:31:19 pM#;
0252 select #11:11 AM#;
0253 select #11:11 PM#;
0254 select #11:11    AM#;
0255 select #11:11    PM#;
0256 select #11:11AM#;
0257 select #11:11PM#;
0258 select #11:11am#;
0259 select #11:11pm#;
0260 select #1:31 aM#;
0261 select #1:31 Am#;
0262 select #1:31 am#;
0263 select #1:31 pM#;
0264 select #1:31 pM#;
0265 -- ERROR: Time Constants: invalid characters/format
0266 select #001:17:59#;
0267 select #01:017:59#;
0268 select #01:017:059#;
0269 select #001:017:59#;
0270 select #01:017:059#;
0271 select #001:17:059#;
0272 select #001;017:059#;
0273 select #01:17:59;
0274 select #01::17:59#;
0275 select ##01::17:59#;
0276 select #01#;
0277 select #0#;
0278 select #11:17 #;
0279 select #11: 17#;
0280 select #11 : 17#;
0281 select #11 :17#;
0282 select #11::17#;
0283 select # 11:17#;
0284 select #11:17 AM #;
0285 select #1:17 PM #;
0286 select # 11:17 AM#;
0287 select # 11:17 AM #;
0288 select # 1:17 PM#;
0289 select # 1:17 PM #;
0290 select #o1:17#;
0291 select #1:17a#;
0292 select #1:17p#;
0293 select #1:17 p#;
0294 select #1:17 pr#;
0295 -- ERROR: Time Constants: invalid hour
0296 select #24:17:59#;
0297 select #28:17:59#;
0298 select #13:17:59 AM#;
0299 select #23:17:59 PM#;
0300 select #13:17 AM#;
0301 select #23:17 PM#;
0302 
0303 -- Date/Time Constants (KDbSQL EXTENSION)
0304 -- https://community.kde.org/Kexi/Plugins/Queries/SQL_Constants
0305 -- TODO
0306 
0307 -- TRUE and FALSE constants (KDbSQL EXTENSION)
0308 select TRUE;
0309 select TRUE, NOT FALSE;
0310 select NOT NOT TRUE;
0311 select NOT NULL;
0312 select NOT (NOT TRUE);
0313 select TRUE != FALSE;
0314 select TRUE <> FALSE;
0315 select TRUE OR FALSE;
0316 select TRUE XOR FALSE;
0317 select TRUE AND NOT FALSE;
0318 select TRUE < FALSE;
0319 select TRUE IS NULL;
0320 select TRUE <> TRUE OR FALSE == TRUE;
0321 -- ERROR: 'IS' is reserved keyword
0322 select TRUE IS NOT FALSE;
0323 -- IS NULL/IS NOT NULL
0324 select 1 IS NOT NULL;
0325 select NULL IS NULL;
0326 select NULL IS NOT NULL;
0327 -- ERROR: Extra ';'
0328 select 1; 2;
0329 -- Unary operators
0330 select -1;
0331 select --1;
0332 select +1;
0333 select ++1;
0334 select +--+-1;
0335 select -NULL;
0336 select +NULL;
0337 -- Binary operators
0338 select 1+2;
0339 select 1-2;
0340 select 1*2;
0341 select 1/2;
0342 select 1&2;
0343 select 1|2;
0344 select 1%2;
0345 select 2 >> 4;
0346 select 2 << 4;
0347 select 2 <> 4;
0348 select 2 != -4;
0349 select 2 = -4;
0350 select 2 == -4;
0351 select 2 > 4;
0352 select 2 < 4;
0353 select 2 <= 4;
0354 select 2 >= -4;
0355 select NULL + NULL;
0356 select 7 + NULL;
0357 select NULL - NULL;
0358 select 7 - NULL;
0359 select NULL * NULL;
0360 select 7 * NULL;
0361 select NULL / NULL;
0362 select 7 / NULL;
0363 select NULL & NULL;
0364 select 7 & NULL;
0365 select NULL | NULL;
0366 select 7 | NULL;
0367 select NULL % NULL;
0368 select 7 % NULL;
0369 select NULL >> NULL;
0370 select 7 >> NULL;
0371 select NULL << NULL;
0372 select 7 << NULL;
0373 select NULL <> NULL;
0374 select 7 <> NULL;
0375 select NULL != NULL;
0376 select 7 != NULL;
0377 select NULL == NULL;
0378 select 7 == NULL;
0379 select NULL > NULL;
0380 select 7 > NULL;
0381 select NULL < NULL;
0382 select 7 < NULL;
0383 select NULL >= NULL;
0384 select 7 >= NULL;
0385 select NULL <= NULL;
0386 select 7 <= NULL;
0387 select 'ABC' LIKE 'A%';
0388 select 'ABC' NOT LIKE 'A%';
0389 select 'ABC' LIKE NULL;
0390 select NULL LIKE NULL;
0391 select NULL NOT LIKE NULL;
0392 select 1 BETWEEN 0 AND 5;
0393 select NULL BETWEEN 1 AND 5;
0394 select 1 BETWEEN NULL AND 5;
0395 select 1 BETWEEN 0 AND NULL;
0396 select NULL BETWEEN NULL AND NULL;
0397 select 3 SIMILAR TO 4;
0398 select NULL SIMILAR TO 4;
0399 select 3 NOT SIMILAR TO 4;
0400 select NULL SIMILAR TO NULL;
0401 select 'AB' || 'CD';
0402 select "AB" ||"CD";
0403 select 'AB'||"CD"a;
0404 select 'AB' || 'CD' || 'EF';
0405 select 'AB' + 'CD' || 'EF' + 'GH' || '';
0406 select NULL || NULL;
0407 select NULL || 'AB';
0408 select 'AB' + NULL;
0409 -- ERROR: ||
0410 select 'AB' || 1;
0411 select 'AB' + 1;
0412 select 7 || 'AB';
0413 select 7 + 'AB';
0414 select 7 || 1;
0415 -- ERROR: Type error near "1"
0416 select 'ABC' NOT LIKE 1;
0417 select 'ABC' NOT LIKE;
0418 select 3 SIMILAR TO;
0419 select 1 BETWEEN 'a' AND 5;
0420 -- ERROR: **
0421 select 1**2;
0422 -- ERROR: * or / are not unary operators
0423 select *2;
0424 select /2;
0425 -- ERROR: operators after argument
0426 select 2+;
0427 select 2-;
0428 select 2*;
0429 select 2/;
0430 -- ERROR: unfinished '
0431 select ';
0432 select ";
0433 select \';
0434 select \"a";
0435 select 1';
0436 
0437 ---------- CATEGORY: Aliases in select statement --------------
0438 -- Aliases for columns
0439 select id myid from persons;
0440 select id as myid from persons;
0441 -- Aliases for tables
0442 select id from persons p;
0443 -- ERROR: There's no "persons" table in this query (alias "p" covers it)
0444 select persons.id from persons p;
0445 -- Alias "p" for table "persons" is used
0446 select p.id from persons p;
0447 -- Multiple aliases for the same table
0448 select persons.id from persons, persons p, persons p2;
0449 -- ERROR: Column "id" is defined in both tables (so "id" column is ambiguous)
0450 select id from persons p, cars p;
0451 select id from persons p, cars c;
0452 -- ERROR: Table alias "p" is assigned twice
0453 select p.id from persons p, cars p;
0454 select 1 from persons p, cars p;
0455 select p.model from persons p, cars p;
0456 -- ERROR: Table alias "p" is assigned twice and both have "id" column referenced by "p.*" so "p.*" is ambiguous
0457 select p.* from persons p, cars p;
0458 -- ERROR: Table alias "persons" is assigned and "persons" table is also used; both have "id" column referenced by "persons.*" so "persons.*" is ambiguous
0459 select persons.* from persons, cars persons;
0460 -- ERROR: Table alias "p" is assigned twice and both have "id" column referenced by "*" so "*" is ambiguous
0461 select * from persons p, cars p;
0462 -- ERROR: Column alias not allowed for all-tables asterisk
0463 select * as c from cars;
0464 -- ERROR: Column alias not allowed for table asterisk
0465 select cars.* as c from cars;
0466 
0467 ---------- CATEGORY: Expressions with infix operators in columns of select statement --------------
0468 -- Complex expressions support, operators precedence, and brackets
0469 select NULL IS NOT NULL from cars;
0470 select 2+3*4 from cars;
0471 select (2+3)*4 from cars;
0472 -- Support for aliases for complex-expression columns
0473 select (2+3)*4 from cars;
0474 -- ERROR: Column names are invalidated inside a complex expressions
0475 select one*two from persons;
0476 -- ERROR: Like "select p.id from persons p, cars p" but ambiguous column is inside a complex expression
0477 select id*2 from persons p, cars p;
0478 -- Operators precedence: arithmetic before relational
0479 select 1 + 2 < 3;
0480 -- *,/ before +,-
0481 select 1+2*3;
0482 -- Unary expressions before binary expressions
0483 select 1+-2;
0484 -- ERROR: column not found in expression
0485 select 2 * foo;
0486 -- ERROR: 'NOT' operator cannot be applied to integer
0487 select NOT 2 * 4;
0488 -- Nested '()'
0489 select ((2));
0490 select ((  (2 ) ));
0491 -- ERROR: unmatched '('
0492 select (2;
0493 select 2);
0494 select ((2);
0495 select (2)));
0496 -- column names in expression
0497 select id * id - 2 / id from cars;
0498 select model || "---" || model from cars;
0499 
0500 ---------- CATEGORY: Expressions with scalar functions --------------
0501 -- ABS
0502 SELECT ABS(-27), abs(-3.1415), ABS(NULL + 1);
0503 -- ERROR: ABS
0504 SELECT ABS(); -- 1 arg expected
0505 SELECT ABS(1, 2); -- 1 arg expected
0506 SELECT ABS("a"); -- type error
0507 -- CEILING
0508 SELECT CEILING(3.14), ceiling(-99.001);
0509 SELECT CEILING(0 + 0);
0510 SELECT CEILING(NULL);
0511 -- ERROR: CEILING
0512 SELECT CEILING(); -- 1 arg expected
0513 SELECT CEILING(1, 2); -- 1 arg expected
0514 SELECT CEILING("a"); -- type error
0515 -- CHAR
0516 SELECT CHAR(75,69,88,73), CHAR();
0517 SELECT CHAR(NULL);
0518 SELECT CHAR(NULL, NULL);
0519 -- ERROR: CHAR
0520 SELECT CHAR(''); -- type error
0521 SELECT CHAR(1.23); -- type error
0522 -- COALESCE
0523 SELECT COALESCE(NULL, 17, NULL, "A");
0524 SELECT COALESCE(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); -- 100 args == KDB_MAX_FUNCTION_ARGS
0525 -- ERROR: COALESCE
0526 SELECT COALESCE(); -- 2 or more args expected
0527 SELECT COALESCE(1); -- 2 or more args expected
0528 SELECT COALESCE(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); -- 101 args is more than KDB_MAX_FUNCTION_ARGS
0529 -- FLOOR
0530 SELECT FLOOR(3.14), FLOOR(-99.001);
0531 SELECT FLOOR(0 + 0);
0532 SELECT FLOOR(NULL);
0533 -- ERROR: FLOOR
0534 SELECT FLOOR(); -- 1 arg expected
0535 SELECT FLOOR(1, 2); -- 1 arg expected
0536 SELECT FLOOR("a"); -- type error
0537 -- TODO: more functions...
0538 -- ERROR: unknown scalar function
0539 SELECT foobar();
0540 
0541 ---------- CATEGORY: "WHERE" section --------------
0542 -- ERROR: Empty WHERE section
0543 select id from cars where;
0544 -- WHERE section without columns
0545 select from cars where TRUE;
0546 -- Complex expressions in WHERE section
0547 select id from cars where (id > 2 OR cars.owner IS NULL) AND 2 * id < 5;
0548 
0549 ---------- CATEGORY: "ORDER BY" section of select statement --------------
0550 -- Simple ORDER BY
0551 select id from cars order by id;
0552 -- Simple ORDER BY with DESC
0553 select id from cars order by id DESC;
0554 -- Simple ORDER BY with ASC
0555 select id from cars order by id ASC;
0556 -- Simple ORDER BY with ASC and DESC
0557 select id, model from cars order by id ASC, model DESC;
0558 -- Simple ORDER BY with WHERE
0559 select id from cars order by id WHERE id < 5;
0560 -- Simple ORDER BY with WHERE; opposite direction
0561 select id from cars WHERE id < 5 order by id;
0562 -- Simple ORDER BY, sorting field 'owner' is not in the list of displayed fields
0563 select id from cars order by owner;
0564 -- ORDER BY with many arguments
0565 select id from cars order by owner, model, id;
0566 -- ORDER BY where column numbers are used instead of names
0567 select id, model from cars order by 2, 1;
0568 -- ERROR: ORDER BY column number 2 out of range - should be between 1 and 1
0569 -- (there's only one visible field)
0570 select id from cars order by 2, 1;
0571 
0572 ---------- CATEGORY: JOINs -------
0573 -- Join persons and cars tables
0574 SELECT persons.name, persons.surname, persons.age, cars.model FROM persons, cars WHERE persons.id = cars.owner;
0575 -- Join persons and cars tables, skip table names where possible
0576 SELECT name, surname, age, model FROM persons, cars WHERE persons.id = owner;
0577 -- Join persons and cars tables, sort by surname+name
0578 SELECT persons.name, persons.surname, persons.age, cars.model FROM persons, cars WHERE persons.id = cars.owner ORDER BY 2, 1;
0579 -- Join persons and cars tables, sort using aliases
0580 SELECT persons.name as p_name, persons.surname, persons.age as p_age, cars.model FROM persons, cars WHERE persons.id = cars.owner ORDER BY p_age, p_name;
0581 
0582 ---------- CATEGORY: Parameters -------
0583 -- Parameters in column expressions
0584 SELECT [p];
0585 SELECT [p q];
0586 SELECT [ą]; -- non-latin1 character
0587 SELECT ["];
0588 SELECT ['];
0589 SELECT [`];
0590 SELECT [\];
0591 SELECT [=];
0592 SELECT [*];
0593 SELECT [;];
0594 SELECT [,];
0595 SELECT [(];
0596 SELECT [)];
0597 SELECT [%];
0598 SELECT [p] + [q];
0599 SELECT [p] + [p];
0600 SELECT [p]||[q];
0601 SELECT [p], [q];
0602 SELECT [p], [p]; -- two the same parameters
0603 SELECT [SELECT]; -- keywords as parameter names allowed
0604 SELECT [p]a; -- [p] AS a
0605 SELECT[p]; -- no whitespace needed
0606 SELECT TRIM(name, [c]) FROM persons;
0607 SELECT [c] FROM persons;
0608 -- ERROR: unexpected character after parameter in column expression
0609 SELECT [p]a/2;
0610 SELECT [p][q];
0611 SELECT [p] [q];
0612 -- ERROR: unexpected character in parameter name
0613 SELECT [[];
0614 SELECT [\[];
0615 -- ERROR: empty parameter name
0616 SELECT [];
0617 -- ERROR: parameter in alias name
0618 SELECT [p] AS [q];
0619 -- ERROR: parameter in ORDER BY argument
0620 SELECT * FROM cars ORDER BY [x];
0621 -- Parameters in conditions
0622 SELECT name, surname, age, model FROM persons, cars WHERE persons.id = owner AND model = [Enter model];
0623 SELECT [Enter], name, surname, age, model FROM persons, cars WHERE persons.id = [Enter ID] AND [Enter model] = model;
0624 SELECT * FROM cars WHERE [Boolean condition];
0625 SELECT * FROM cars WHERE [a] < [b];
0626 SELECT FROM cars WHERE [a] < [b];
0627 SELECT LTRIM(name, [c]) FROM persons, cars WHERE persons.id = owner AND name = [Enter model];
0628 -- ERROR: unexpected character in parameter name in condition
0629 SELECT * FROM cars WHERE model = [Boolean condition]a;
0630 -- ERROR: empty parameter name in condition
0631 SELECT * FROM cars WHERE model = [];