mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 19:23:03 +01:00
Let Ivan Prenosil test his beloved transaction options.
This commit is contained in:
parent
5bc24fdd2b
commit
90174410a2
@ -2774,6 +2774,14 @@ void DSQL_pretty(const dsql_nod* node, int column)
|
||||
case nod_returning:
|
||||
verb = "returning";
|
||||
break;
|
||||
|
||||
case nod_tra_misc:
|
||||
verb = "tra_misc";
|
||||
break;
|
||||
|
||||
case nod_lock_timeout:
|
||||
verb = "lock_timeout"; // maybe show the timeout value?
|
||||
break;
|
||||
|
||||
default:
|
||||
sprintf(s, "unknown type %d", node->nod_type);
|
||||
|
@ -1,276 +1,293 @@
|
||||
#define ACTIVE 257
|
||||
#define ADD 258
|
||||
#define AFTER 259
|
||||
#define ALL 260
|
||||
#define ALTER 261
|
||||
#define AND 262
|
||||
#define ANY 263
|
||||
#define AS 264
|
||||
#define ASC 265
|
||||
#define AT 266
|
||||
#define AVG 267
|
||||
#define AUTO 268
|
||||
#define BEFORE 269
|
||||
#define BEGIN 270
|
||||
#define BETWEEN 271
|
||||
#define BLOB 272
|
||||
#define BY 273
|
||||
#define CAST 274
|
||||
#define CHARACTER 275
|
||||
#define CHECK 276
|
||||
#define COLLATE 277
|
||||
#define COMMA 278
|
||||
#define COMMIT 279
|
||||
#define COMMITTED 280
|
||||
#define COMPUTED 281
|
||||
#define CONCATENATE 282
|
||||
#define CONDITIONAL 283
|
||||
#define CONSTRAINT 284
|
||||
#define CONTAINING 285
|
||||
#define COUNT 286
|
||||
#define CREATE 287
|
||||
#define CSTRING 288
|
||||
#define CURRENT 289
|
||||
#define CURSOR 290
|
||||
#define DATABASE 291
|
||||
#define DATE 292
|
||||
#define DB_KEY 293
|
||||
#define KW_DEBUG 294
|
||||
#define DECIMAL 295
|
||||
#define DECLARE 296
|
||||
#define DEFAULT 297
|
||||
#define KW_DELETE 298
|
||||
#define DESC 299
|
||||
#define DISTINCT 300
|
||||
#define DO 301
|
||||
#define DOMAIN 302
|
||||
#define DROP 303
|
||||
#define ELSE 304
|
||||
#define END 305
|
||||
#define ENTRY_POINT 306
|
||||
#define EQL 307
|
||||
#define ESCAPE 308
|
||||
#define EXCEPTION 309
|
||||
#define EXECUTE 310
|
||||
#define EXISTS 311
|
||||
#define EXIT 312
|
||||
#define EXTERNAL 313
|
||||
#define FILTER 314
|
||||
#define FOR 315
|
||||
#define FOREIGN 316
|
||||
#define FROM 317
|
||||
#define FULL 318
|
||||
#define FUNCTION 319
|
||||
#define GDSCODE 320
|
||||
#define GEQ 321
|
||||
#define GENERATOR 322
|
||||
#define GEN_ID 323
|
||||
#define GRANT 324
|
||||
#define GROUP 325
|
||||
#define GTR 326
|
||||
#define HAVING 327
|
||||
#define IF 328
|
||||
#define KW_IN 329
|
||||
#define INACTIVE 330
|
||||
#define INNER 331
|
||||
#define INPUT_TYPE 332
|
||||
#define INDEX 333
|
||||
#define INSERT 334
|
||||
#define INTEGER 335
|
||||
#define INTO 336
|
||||
#define IS 337
|
||||
#define ISOLATION 338
|
||||
#define JOIN 339
|
||||
#define KEY 340
|
||||
#define KW_CHAR 341
|
||||
#define KW_DEC 342
|
||||
#define KW_DOUBLE 343
|
||||
#define KW_FILE 344
|
||||
#define KW_FLOAT 345
|
||||
#define KW_INT 346
|
||||
#define KW_LONG 347
|
||||
#define KW_NULL 348
|
||||
#define KW_NUMERIC 349
|
||||
#define KW_UPPER 350
|
||||
#define KW_VALUE 351
|
||||
#define LENGTH 352
|
||||
#define LPAREN 353
|
||||
#define LEFT 354
|
||||
#define LEQ 355
|
||||
#define LEVEL 356
|
||||
#define LIKE 357
|
||||
#define LSS 358
|
||||
#define MANUAL 359
|
||||
#define MAXIMUM 360
|
||||
#define MAX_SEGMENT 361
|
||||
#define MERGE 362
|
||||
#define MESSAGE 363
|
||||
#define MINIMUM 364
|
||||
#define MODULE_NAME 365
|
||||
#define NAMES 366
|
||||
#define NATIONAL 367
|
||||
#define NATURAL 368
|
||||
#define NCHAR 369
|
||||
#define NEQ 370
|
||||
#define NO 371
|
||||
#define NOT 372
|
||||
#define NOT_GTR 373
|
||||
#define NOT_LSS 374
|
||||
#define OF 375
|
||||
#define ON 376
|
||||
#define ONLY 377
|
||||
#define OPTION 378
|
||||
#define OR 379
|
||||
#define ORDER 380
|
||||
#define OUTER 381
|
||||
#define OUTPUT_TYPE 382
|
||||
#define OVERFLOW 383
|
||||
#define PAGE 384
|
||||
#define PAGES 385
|
||||
#define KW_PAGE_SIZE 386
|
||||
#define PARAMETER 387
|
||||
#define PASSWORD 388
|
||||
#define PLAN 389
|
||||
#define POSITION 390
|
||||
#define POST_EVENT 391
|
||||
#define PRECISION 392
|
||||
#define PRIMARY 393
|
||||
#define PRIVILEGES 394
|
||||
#define PROCEDURE 395
|
||||
#define PROTECTED 396
|
||||
#define READ 397
|
||||
#define REAL 398
|
||||
#define REFERENCES 399
|
||||
#define RESERVING 400
|
||||
#define RETAIN 401
|
||||
#define RETURNING_VALUES 402
|
||||
#define RETURNS 403
|
||||
#define REVOKE 404
|
||||
#define RIGHT 405
|
||||
#define RPAREN 406
|
||||
#define ROLLBACK 407
|
||||
#define SEGMENT 408
|
||||
#define SELECT 409
|
||||
#define SET 410
|
||||
#define SHADOW 411
|
||||
#define KW_SHARED 412
|
||||
#define SINGULAR 413
|
||||
#define KW_SIZE 414
|
||||
#define SMALLINT 415
|
||||
#define SNAPSHOT 416
|
||||
#define SOME 417
|
||||
#define SORT 418
|
||||
#define SQLCODE 419
|
||||
#define STABILITY 420
|
||||
#define STARTING 421
|
||||
#define STATISTICS 422
|
||||
#define SUB_TYPE 423
|
||||
#define SUSPEND 424
|
||||
#define SUM 425
|
||||
#define TABLE 426
|
||||
#define THEN 427
|
||||
#define TO 428
|
||||
#define TRANSACTION 429
|
||||
#define TRIGGER 430
|
||||
#define UNCOMMITTED 431
|
||||
#define UNION 432
|
||||
#define UNIQUE 433
|
||||
#define UPDATE 434
|
||||
#define USER 435
|
||||
#define VALUES 436
|
||||
#define VARCHAR 437
|
||||
#define VARIABLE 438
|
||||
#define VARYING 439
|
||||
#define VERSION 440
|
||||
#define VIEW 441
|
||||
#define WAIT 442
|
||||
#define WHEN 443
|
||||
#define WHERE 444
|
||||
#define WHILE 445
|
||||
#define WITH 446
|
||||
#define WORK 447
|
||||
#define WRITE 448
|
||||
#define FLOAT_NUMBER 449
|
||||
#define NUMBER 450
|
||||
#define NUMERIC 451
|
||||
#define SYMBOL 452
|
||||
#define STRING 453
|
||||
#define INTRODUCER 454
|
||||
#define ACTION 455
|
||||
#define ADMIN 456
|
||||
#define CASCADE 457
|
||||
#define FREE_IT 458
|
||||
#define RESTRICT 459
|
||||
#define ROLE 460
|
||||
#define COLUMN 461
|
||||
#define TYPE 462
|
||||
#define EXTRACT 463
|
||||
#define YEAR 464
|
||||
#define MONTH 465
|
||||
#define DAY 466
|
||||
#define HOUR 467
|
||||
#define MINUTE 468
|
||||
#define SECOND 469
|
||||
#define WEEKDAY 470
|
||||
#define YEARDAY 471
|
||||
#define TIME 472
|
||||
#define TIMESTAMP 473
|
||||
#define CURRENT_DATE 474
|
||||
#define CURRENT_TIME 475
|
||||
#define CURRENT_TIMESTAMP 476
|
||||
#define NUMBER64BIT 477
|
||||
#define SCALEDINT 478
|
||||
#define CURRENT_USER 479
|
||||
#define CURRENT_ROLE 480
|
||||
#define KW_BREAK 481
|
||||
#define SUBSTRING 482
|
||||
#define RECREATE 483
|
||||
#define KW_DESCRIPTOR 484
|
||||
#define FIRST 485
|
||||
#define SKIP 486
|
||||
#define CURRENT_CONNECTION 487
|
||||
#define CURRENT_TRANSACTION 488
|
||||
#define BIGINT 489
|
||||
#define CASE 490
|
||||
#define NULLIF 491
|
||||
#define COALESCE 492
|
||||
#define USING 493
|
||||
#define NULLS 494
|
||||
#define LAST 495
|
||||
#define ROW_COUNT 496
|
||||
#define LOCK 497
|
||||
#define SAVEPOINT 498
|
||||
#define RELEASE 499
|
||||
#define STATEMENT 500
|
||||
#define LEAVE 501
|
||||
#define INSERTING 502
|
||||
#define UPDATING 503
|
||||
#define DELETING 504
|
||||
#define KW_INSERTING 505
|
||||
#define KW_UPDATING 506
|
||||
#define KW_DELETING 507
|
||||
#define BACKUP 508
|
||||
#define KW_DIFFERENCE 509
|
||||
#define OPEN 510
|
||||
#define CLOSE 511
|
||||
#define FETCH 512
|
||||
#define ROWS 513
|
||||
#define BLOCK 514
|
||||
#define IIF 515
|
||||
#define SCALAR_ARRAY 516
|
||||
#define CROSS 517
|
||||
#define NEXT 518
|
||||
#define SEQUENCE 519
|
||||
#define RESTART 520
|
||||
#define BOTH 521
|
||||
#define COLLATION 522
|
||||
#define COMMENT 523
|
||||
#define BIT_LENGTH 524
|
||||
#define CHAR_LENGTH 525
|
||||
#define CHARACTER_LENGTH 526
|
||||
#define LEADING 527
|
||||
#define KW_LOWER 528
|
||||
#define OCTET_LENGTH 529
|
||||
#define TRAILING 530
|
||||
#define TRIM 531
|
||||
#define RETURNING 532
|
||||
#ifndef BISON_DSQL_TAB_H
|
||||
# define BISON_DSQL_TAB_H
|
||||
|
||||
# ifndef YYSTYPE
|
||||
# define YYSTYPE int
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# endif
|
||||
# define ACTIVE 257
|
||||
# define ADD 258
|
||||
# define AFTER 259
|
||||
# define ALL 260
|
||||
# define ALTER 261
|
||||
# define AND 262
|
||||
# define ANY 263
|
||||
# define AS 264
|
||||
# define ASC 265
|
||||
# define AT 266
|
||||
# define AVG 267
|
||||
# define AUTO 268
|
||||
# define BEFORE 269
|
||||
# define BEGIN 270
|
||||
# define BETWEEN 271
|
||||
# define BLOB 272
|
||||
# define BY 273
|
||||
# define CAST 274
|
||||
# define CHARACTER 275
|
||||
# define CHECK 276
|
||||
# define COLLATE 277
|
||||
# define COMMA 278
|
||||
# define COMMIT 279
|
||||
# define COMMITTED 280
|
||||
# define COMPUTED 281
|
||||
# define CONCATENATE 282
|
||||
# define CONDITIONAL 283
|
||||
# define CONSTRAINT 284
|
||||
# define CONTAINING 285
|
||||
# define COUNT 286
|
||||
# define CREATE 287
|
||||
# define CSTRING 288
|
||||
# define CURRENT 289
|
||||
# define CURSOR 290
|
||||
# define DATABASE 291
|
||||
# define DATE 292
|
||||
# define DB_KEY 293
|
||||
# define KW_DEBUG 294
|
||||
# define DECIMAL 295
|
||||
# define DECLARE 296
|
||||
# define DEFAULT 297
|
||||
# define KW_DELETE 298
|
||||
# define DESC 299
|
||||
# define DISTINCT 300
|
||||
# define DO 301
|
||||
# define DOMAIN 302
|
||||
# define DROP 303
|
||||
# define ELSE 304
|
||||
# define END 305
|
||||
# define ENTRY_POINT 306
|
||||
# define EQL 307
|
||||
# define ESCAPE 308
|
||||
# define EXCEPTION 309
|
||||
# define EXECUTE 310
|
||||
# define EXISTS 311
|
||||
# define EXIT 312
|
||||
# define EXTERNAL 313
|
||||
# define FILTER 314
|
||||
# define FOR 315
|
||||
# define FOREIGN 316
|
||||
# define FROM 317
|
||||
# define FULL 318
|
||||
# define FUNCTION 319
|
||||
# define GDSCODE 320
|
||||
# define GEQ 321
|
||||
# define GENERATOR 322
|
||||
# define GEN_ID 323
|
||||
# define GRANT 324
|
||||
# define GROUP 325
|
||||
# define GTR 326
|
||||
# define HAVING 327
|
||||
# define IF 328
|
||||
# define KW_IN 329
|
||||
# define INACTIVE 330
|
||||
# define INNER 331
|
||||
# define INPUT_TYPE 332
|
||||
# define INDEX 333
|
||||
# define INSERT 334
|
||||
# define INTEGER 335
|
||||
# define INTO 336
|
||||
# define IS 337
|
||||
# define ISOLATION 338
|
||||
# define JOIN 339
|
||||
# define KEY 340
|
||||
# define KW_CHAR 341
|
||||
# define KW_DEC 342
|
||||
# define KW_DOUBLE 343
|
||||
# define KW_FILE 344
|
||||
# define KW_FLOAT 345
|
||||
# define KW_INT 346
|
||||
# define KW_LONG 347
|
||||
# define KW_NULL 348
|
||||
# define KW_NUMERIC 349
|
||||
# define KW_UPPER 350
|
||||
# define KW_VALUE 351
|
||||
# define LENGTH 352
|
||||
# define LPAREN 353
|
||||
# define LEFT 354
|
||||
# define LEQ 355
|
||||
# define LEVEL 356
|
||||
# define LIKE 357
|
||||
# define LSS 358
|
||||
# define MANUAL 359
|
||||
# define MAXIMUM 360
|
||||
# define MAX_SEGMENT 361
|
||||
# define MERGE 362
|
||||
# define MESSAGE 363
|
||||
# define MINIMUM 364
|
||||
# define MODULE_NAME 365
|
||||
# define NAMES 366
|
||||
# define NATIONAL 367
|
||||
# define NATURAL 368
|
||||
# define NCHAR 369
|
||||
# define NEQ 370
|
||||
# define NO 371
|
||||
# define NOT 372
|
||||
# define NOT_GTR 373
|
||||
# define NOT_LSS 374
|
||||
# define OF 375
|
||||
# define ON 376
|
||||
# define ONLY 377
|
||||
# define OPTION 378
|
||||
# define OR 379
|
||||
# define ORDER 380
|
||||
# define OUTER 381
|
||||
# define OUTPUT_TYPE 382
|
||||
# define OVERFLOW 383
|
||||
# define PAGE 384
|
||||
# define PAGES 385
|
||||
# define KW_PAGE_SIZE 386
|
||||
# define PARAMETER 387
|
||||
# define PASSWORD 388
|
||||
# define PLAN 389
|
||||
# define POSITION 390
|
||||
# define POST_EVENT 391
|
||||
# define PRECISION 392
|
||||
# define PRIMARY 393
|
||||
# define PRIVILEGES 394
|
||||
# define PROCEDURE 395
|
||||
# define PROTECTED 396
|
||||
# define READ 397
|
||||
# define REAL 398
|
||||
# define REFERENCES 399
|
||||
# define RESERVING 400
|
||||
# define RETAIN 401
|
||||
# define RETURNING_VALUES 402
|
||||
# define RETURNS 403
|
||||
# define REVOKE 404
|
||||
# define RIGHT 405
|
||||
# define RPAREN 406
|
||||
# define ROLLBACK 407
|
||||
# define SEGMENT 408
|
||||
# define SELECT 409
|
||||
# define SET 410
|
||||
# define SHADOW 411
|
||||
# define KW_SHARED 412
|
||||
# define SINGULAR 413
|
||||
# define KW_SIZE 414
|
||||
# define SMALLINT 415
|
||||
# define SNAPSHOT 416
|
||||
# define SOME 417
|
||||
# define SORT 418
|
||||
# define SQLCODE 419
|
||||
# define STABILITY 420
|
||||
# define STARTING 421
|
||||
# define STATISTICS 422
|
||||
# define SUB_TYPE 423
|
||||
# define SUSPEND 424
|
||||
# define SUM 425
|
||||
# define TABLE 426
|
||||
# define THEN 427
|
||||
# define TO 428
|
||||
# define TRANSACTION 429
|
||||
# define TRIGGER 430
|
||||
# define UNCOMMITTED 431
|
||||
# define UNION 432
|
||||
# define UNIQUE 433
|
||||
# define UPDATE 434
|
||||
# define USER 435
|
||||
# define VALUES 436
|
||||
# define VARCHAR 437
|
||||
# define VARIABLE 438
|
||||
# define VARYING 439
|
||||
# define VERSION 440
|
||||
# define VIEW 441
|
||||
# define WAIT 442
|
||||
# define WHEN 443
|
||||
# define WHERE 444
|
||||
# define WHILE 445
|
||||
# define WITH 446
|
||||
# define WORK 447
|
||||
# define WRITE 448
|
||||
# define FLOAT_NUMBER 449
|
||||
# define NUMBER 450
|
||||
# define NUMERIC 451
|
||||
# define SYMBOL 452
|
||||
# define STRING 453
|
||||
# define INTRODUCER 454
|
||||
# define ACTION 455
|
||||
# define ADMIN 456
|
||||
# define CASCADE 457
|
||||
# define FREE_IT 458
|
||||
# define RESTRICT 459
|
||||
# define ROLE 460
|
||||
# define COLUMN 461
|
||||
# define TYPE 462
|
||||
# define EXTRACT 463
|
||||
# define YEAR 464
|
||||
# define MONTH 465
|
||||
# define DAY 466
|
||||
# define HOUR 467
|
||||
# define MINUTE 468
|
||||
# define SECOND 469
|
||||
# define WEEKDAY 470
|
||||
# define YEARDAY 471
|
||||
# define TIME 472
|
||||
# define TIMESTAMP 473
|
||||
# define CURRENT_DATE 474
|
||||
# define CURRENT_TIME 475
|
||||
# define CURRENT_TIMESTAMP 476
|
||||
# define NUMBER64BIT 477
|
||||
# define SCALEDINT 478
|
||||
# define CURRENT_USER 479
|
||||
# define CURRENT_ROLE 480
|
||||
# define KW_BREAK 481
|
||||
# define SUBSTRING 482
|
||||
# define RECREATE 483
|
||||
# define KW_DESCRIPTOR 484
|
||||
# define FIRST 485
|
||||
# define SKIP 486
|
||||
# define CURRENT_CONNECTION 487
|
||||
# define CURRENT_TRANSACTION 488
|
||||
# define BIGINT 489
|
||||
# define CASE 490
|
||||
# define NULLIF 491
|
||||
# define COALESCE 492
|
||||
# define USING 493
|
||||
# define NULLS 494
|
||||
# define LAST 495
|
||||
# define ROW_COUNT 496
|
||||
# define LOCK 497
|
||||
# define SAVEPOINT 498
|
||||
# define RELEASE 499
|
||||
# define STATEMENT 500
|
||||
# define LEAVE 501
|
||||
# define INSERTING 502
|
||||
# define UPDATING 503
|
||||
# define DELETING 504
|
||||
# define KW_INSERTING 505
|
||||
# define KW_UPDATING 506
|
||||
# define KW_DELETING 507
|
||||
# define BACKUP 508
|
||||
# define KW_DIFFERENCE 509
|
||||
# define OPEN 510
|
||||
# define CLOSE 511
|
||||
# define FETCH 512
|
||||
# define ROWS 513
|
||||
# define BLOCK 514
|
||||
# define IIF 515
|
||||
# define SCALAR_ARRAY 516
|
||||
# define CROSS 517
|
||||
# define NEXT 518
|
||||
# define SEQUENCE 519
|
||||
# define RESTART 520
|
||||
# define BOTH 521
|
||||
# define COLLATION 522
|
||||
# define COMMENT 523
|
||||
# define BIT_LENGTH 524
|
||||
# define CHAR_LENGTH 525
|
||||
# define CHARACTER_LENGTH 526
|
||||
# define LEADING 527
|
||||
# define KW_LOWER 528
|
||||
# define OCTET_LENGTH 529
|
||||
# define TRAILING 530
|
||||
# define TRIM 531
|
||||
# define RETURNING 532
|
||||
# define IGNORE 533
|
||||
# define LIMBO 534
|
||||
# define UNDO 535
|
||||
# define REQUESTS 536
|
||||
# define TIMEOUT 537
|
||||
|
||||
|
||||
extern YYSTYPE yylval;
|
||||
|
||||
#endif /* not BISON_DSQL_TAB_H */
|
||||
|
@ -371,7 +371,8 @@ void GEN_expr( dsql_req* request, dsql_nod* node)
|
||||
{
|
||||
dsql_nod* child = node->nod_arg[0];
|
||||
if (child->nod_type == nod_constant &&
|
||||
DTYPE_IS_NUMERIC(child->nod_desc.dsc_dtype)) {
|
||||
DTYPE_IS_NUMERIC(child->nod_desc.dsc_dtype))
|
||||
{
|
||||
gen_constant(request, &child->nod_desc, NEGATE_VALUE);
|
||||
return;
|
||||
}
|
||||
@ -763,8 +764,8 @@ void GEN_start_transaction( dsql_req* request, const dsql_nod* tran_node)
|
||||
if (!node)
|
||||
return;
|
||||
|
||||
/* find out isolation level - if specified. This is required for
|
||||
* specifying the correct lock level in reserving clause. */
|
||||
// Find out isolation level - if specified. This is required for
|
||||
// specifying the correct lock level in reserving clause.
|
||||
|
||||
USHORT lock_level = isc_tpb_shared;
|
||||
|
||||
@ -782,13 +783,15 @@ void GEN_start_transaction( dsql_req* request, const dsql_nod* tran_node)
|
||||
|
||||
|
||||
bool sw_access = false, sw_wait = false, sw_isolation = false,
|
||||
sw_reserve = false;
|
||||
sw_reserve = false, sw_lock_timeout = false;
|
||||
int misc_flags = 0;
|
||||
|
||||
// Stuff some version info.
|
||||
if (count = node->nod_count)
|
||||
stuff(request, isc_tpb_version1);
|
||||
|
||||
while (count--) {
|
||||
while (count--)
|
||||
{
|
||||
const dsql_nod* ptr = node->nod_arg[count];
|
||||
|
||||
if (!ptr)
|
||||
@ -866,6 +869,35 @@ void GEN_start_transaction( dsql_req* request, const dsql_nod* tran_node)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case nod_tra_misc:
|
||||
if (misc_flags & ptr->nod_flags)
|
||||
ERRD_post(isc_sqlerr, isc_arg_number, (SLONG) - 104,
|
||||
isc_arg_gds, isc_dsql_dup_option, 0);
|
||||
|
||||
misc_flags |= ptr->nod_flags;
|
||||
if (ptr->nod_flags & NOD_NO_AUTO_UNDO)
|
||||
stuff(request, isc_tpb_no_auto_undo);
|
||||
else if (ptr->nod_flags & NOD_IGNORE_LIMBO)
|
||||
stuff(request, isc_tpb_ignore_limbo);
|
||||
else if (ptr->nod_flags & NOD_RESTART_REQUESTS)
|
||||
stuff(request, isc_tpb_restart_requests);
|
||||
break;
|
||||
|
||||
case nod_lock_timeout:
|
||||
if (sw_lock_timeout)
|
||||
ERRD_post(isc_sqlerr, isc_arg_number, (SLONG) - 104,
|
||||
isc_arg_gds, isc_dsql_dup_option, 0);
|
||||
|
||||
sw_lock_timeout = true;
|
||||
if (ptr->nod_count == 1 && ptr->nod_arg[0]->nod_type == nod_constant)
|
||||
{
|
||||
const int lck_timeout = (int)(IPTR) ptr->nod_arg[0]->nod_arg[0];
|
||||
stuff(request, isc_tpb_lock_timeout);
|
||||
stuff(request, 2);
|
||||
stuff_word(request, lck_timeout);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ERRD_post(isc_sqlerr, isc_arg_number, (SLONG) - 104,
|
||||
|
@ -37,7 +37,8 @@
|
||||
// I discovered isql was being fooled and put double quotes around those
|
||||
// special cases unnecessarily.
|
||||
|
||||
static const TOK tokens[] = {
|
||||
static const TOK tokens[] =
|
||||
{
|
||||
{NOT_LSS, "!<", 1, false},
|
||||
{NEQ, "!=", 1, false},
|
||||
{NOT_GTR, "!>", 1, false},
|
||||
@ -51,9 +52,9 @@ static const TOK tokens[] = {
|
||||
{GTR, ">", 1, false},
|
||||
{GEQ, ">=", 1, false},
|
||||
#ifdef FB_NEW_INTL_ALLOW_NOT_READY
|
||||
{ACCENT, "ACCENT", 2, false},
|
||||
{ACCENT, "ACCENT", 2, true},
|
||||
#endif
|
||||
{ACTION, "ACTION", 1, false},
|
||||
{ACTION, "ACTION", 1, true},
|
||||
{ACTIVE, "ACTIVE", 1, false},
|
||||
{ADD, "ADD", 1, false},
|
||||
{ADMIN, "ADMIN", 1, false},
|
||||
@ -68,18 +69,18 @@ static const TOK tokens[] = {
|
||||
{AT, "AT", 1, false},
|
||||
{AUTO, "AUTO", 1, false},
|
||||
{AVG, "AVG", 1, false},
|
||||
{BACKUP, "BACKUP", 2, false},
|
||||
{BACKUP, "BACKUP", 2, true},
|
||||
{BEFORE, "BEFORE", 1, false},
|
||||
{BEGIN, "BEGIN", 1, false},
|
||||
{BETWEEN, "BETWEEN", 1, false},
|
||||
{BIGINT, "BIGINT", 2, false},
|
||||
{BIT_LENGTH, "BIT_LENGTH", 2, false},
|
||||
{BLOB, "BLOB", 1, false},
|
||||
{BLOCK, "BLOCK", 2, false},
|
||||
{BLOCK, "BLOCK", 2, true},
|
||||
{BOTH, "BOTH", 2, false},
|
||||
{KW_BREAK, "BREAK", 2, false},
|
||||
{KW_BREAK, "BREAK", 2, true},
|
||||
{BY, "BY", 1, false},
|
||||
{CASCADE, "CASCADE", 1, false},
|
||||
{CASCADE, "CASCADE", 1, true},
|
||||
{CASE, "CASE", 2, false},
|
||||
{CAST, "CAST", 1, false},
|
||||
{KW_CHAR, "CHAR", 1, false},
|
||||
@ -88,9 +89,9 @@ static const TOK tokens[] = {
|
||||
{CHARACTER_LENGTH, "CHARACTER_LENGTH", 2, false},
|
||||
{CHECK, "CHECK", 1, false},
|
||||
{CLOSE, "CLOSE", 2, false},
|
||||
{COALESCE, "COALESCE", 2, false},
|
||||
{COALESCE, "COALESCE", 2, true},
|
||||
{COLLATE, "COLLATE", 1, false},
|
||||
{COLLATION, "COLLATION", 2, false},
|
||||
{COLLATION, "COLLATION", 2, true},
|
||||
{COLUMN, "COLUMN", 2, false},
|
||||
{COMMENT, "COMMENT", 2, true},
|
||||
{COMMIT, "COMMIT", 1, false},
|
||||
@ -124,8 +125,8 @@ static const TOK tokens[] = {
|
||||
{DELETING, "DELETING", 2, true},
|
||||
{DESC, "DESC", 1, false}, // Alias of DESCENDING
|
||||
{DESC, "DESCENDING", 1, false},
|
||||
{KW_DESCRIPTOR, "DESCRIPTOR", 2, false},
|
||||
{KW_DIFFERENCE, "DIFFERENCE", 2, false},
|
||||
{KW_DESCRIPTOR, "DESCRIPTOR", 2, true},
|
||||
{KW_DIFFERENCE, "DIFFERENCE", 2, true},
|
||||
{DISTINCT, "DISTINCT", 1, false},
|
||||
{DO, "DO", 1, false},
|
||||
{DOMAIN, "DOMAIN", 1, false},
|
||||
@ -148,7 +149,7 @@ static const TOK tokens[] = {
|
||||
{KW_FLOAT, "FLOAT", 1, false},
|
||||
{FOR, "FOR", 1, false},
|
||||
{FOREIGN, "FOREIGN", 1, false},
|
||||
{FREE_IT, "FREE_IT", 1, false},
|
||||
{FREE_IT, "FREE_IT", 1, true},
|
||||
{FROM, "FROM", 1, false},
|
||||
{FULL, "FULL", 1, false},
|
||||
{FUNCTION, "FUNCTION", 1, false},
|
||||
@ -160,7 +161,8 @@ static const TOK tokens[] = {
|
||||
{HAVING, "HAVING", 1, false},
|
||||
{HOUR, "HOUR", 2, false},
|
||||
{IF, "IF", 1, false},
|
||||
{IIF, "IIF", 2, false},
|
||||
{IGNORE, "IGNORE", 2, true},
|
||||
{IIF, "IIF", 2, true},
|
||||
{KW_IN, "IN", 1, false},
|
||||
{INACTIVE, "INACTIVE", 1, false},
|
||||
{INDEX, "INDEX", 1, false},
|
||||
@ -178,13 +180,15 @@ static const TOK tokens[] = {
|
||||
{ISOLATION, "ISOLATION", 1, false},
|
||||
{JOIN, "JOIN", 1, false},
|
||||
{KEY, "KEY", 1, false},
|
||||
{LAST, "LAST", 2, false},
|
||||
{LAST, "LAST", 2, true},
|
||||
{LEADING, "LEADING", 2, false},
|
||||
{LEAVE, "LEAVE", 2, false},
|
||||
{LEAVE, "LEAVE", 2, true},
|
||||
{LEFT, "LEFT", 1, false},
|
||||
{LENGTH, "LENGTH", 1, false},
|
||||
{LEVEL, "LEVEL", 1, false},
|
||||
{LIKE, "LIKE", 1, false},
|
||||
{LIMBO, "LIMBO", 2, true},
|
||||
{LOCK, "LOCK", 2, true},
|
||||
{KW_LONG, "LONG", 1, false},
|
||||
{KW_LOWER, "LOWER", 2, false},
|
||||
{MANUAL, "MANUAL", 1, false},
|
||||
@ -200,13 +204,12 @@ static const TOK tokens[] = {
|
||||
{NATIONAL, "NATIONAL", 1, false},
|
||||
{NATURAL, "NATURAL", 1, false},
|
||||
{NCHAR, "NCHAR", 1, false},
|
||||
{NEXT, "NEXT", 2, false},
|
||||
{NEXT, "NEXT", 2, true},
|
||||
{NO, "NO", 1, false},
|
||||
{NOT, "NOT", 1, false},
|
||||
{NULLIF, "NULLIF", 2, false},
|
||||
{NULLIF, "NULLIF", 2, true},
|
||||
{KW_NULL, "NULL", 1, false},
|
||||
{NULLS, "NULLS", 2, false},
|
||||
{LOCK, "LOCK", 2, false},
|
||||
{NULLS, "NULLS", 2, true},
|
||||
{KW_NUMERIC, "NUMERIC", 1, false},
|
||||
{OCTET_LENGTH, "OCTET_LENGTH", 2, false},
|
||||
{OF, "OF", 1, false},
|
||||
@ -220,7 +223,7 @@ static const TOK tokens[] = {
|
||||
{OUTPUT_TYPE, "OUTPUT_TYPE", 1, false},
|
||||
{OVERFLOW, "OVERFLOW", 1, false},
|
||||
#ifdef FB_NEW_INTL_ALLOW_NOT_READY
|
||||
{PAD, "PAD", 2, false},
|
||||
{PAD, "PAD", 2, true},
|
||||
#endif
|
||||
{PAGE, "PAGE", 1, false},
|
||||
{PAGES, "PAGES", 1, false},
|
||||
@ -242,22 +245,23 @@ static const TOK tokens[] = {
|
||||
{RECREATE, "RECREATE", 2, false},
|
||||
{REFERENCES, "REFERENCES", 1, false},
|
||||
{RELEASE, "RELEASE", 2, false},
|
||||
{REQUESTS, "REQUESTS", 2, true},
|
||||
{RESERVING, "RESERV", 1, false}, // Alias of RESERVING
|
||||
{RESERVING, "RESERVING", 1, false},
|
||||
{RESTART, "RESTART", 2, false},
|
||||
{RESTRICT, "RESTRICT", 1, false},
|
||||
{RESTART, "RESTART", 2, true},
|
||||
{RESTRICT, "RESTRICT", 1, true},
|
||||
{RETAIN, "RETAIN", 1, false},
|
||||
{RETURNING, "RETURNING", 2, false},
|
||||
{RETURNING, "RETURNING", 2, true},
|
||||
{RETURNING_VALUES, "RETURNING_VALUES", 1, false},
|
||||
{RETURNS, "RETURNS", 1, false},
|
||||
{REVOKE, "REVOKE", 1, false},
|
||||
{RIGHT, "RIGHT", 1, false},
|
||||
{ROLE, "ROLE", 1, false},
|
||||
{ROLE, "ROLE", 1, true},
|
||||
{ROLLBACK, "ROLLBACK", 1, false},
|
||||
{ROW_COUNT, "ROW_COUNT", 2, false},
|
||||
{ROWS, "ROWS", 2, false},
|
||||
{SAVEPOINT, "SAVEPOINT", 2, false},
|
||||
{SCALAR_ARRAY, "SCALAR_ARRAY", 2, false},
|
||||
{SCALAR_ARRAY, "SCALAR_ARRAY", 2, true},
|
||||
{DATABASE, "SCHEMA", 1, false}, // Alias of DATABASE
|
||||
{SECOND, "SECOND", 2, false},
|
||||
{SEGMENT, "SEGMENT", 1, false},
|
||||
@ -265,7 +269,7 @@ static const TOK tokens[] = {
|
||||
#ifdef FB_NEW_INTL_ALLOW_NOT_READY
|
||||
{SENSITIVE, "SENSITIVE", 2, false},
|
||||
#endif
|
||||
{SEQUENCE, "SEQUENCE", 2, false},
|
||||
{SEQUENCE, "SEQUENCE", 2, true},
|
||||
{SET, "SET", 1, false},
|
||||
{SHADOW, "SHADOW", 1, false},
|
||||
{KW_SHARED, "SHARED", 1, false},
|
||||
@ -277,15 +281,15 @@ static const TOK tokens[] = {
|
||||
{SOME, "SOME", 1, false},
|
||||
{SORT, "SORT", 1, false},
|
||||
#ifdef FB_NEW_INTL_ALLOW_NOT_READY
|
||||
{SPACE, "SPACE", 2, false},
|
||||
{SPACE, "SPACE", 2, true},
|
||||
#endif
|
||||
{SQLCODE, "SQLCODE", 1, false},
|
||||
{STABILITY, "STABILITY", 1, false},
|
||||
{STARTING, "STARTING", 1, false},
|
||||
{STARTING, "STARTS", 1, false}, // Alias of STARTING
|
||||
{STATEMENT, "STATEMENT", 2, false},
|
||||
{STATEMENT, "STATEMENT", 2, true},
|
||||
{STATISTICS, "STATISTICS", 1, false},
|
||||
{SUBSTRING, "SUBSTRING", 2, false},
|
||||
{SUBSTRING, "SUBSTRING", 2, true},
|
||||
{SUB_TYPE, "SUB_TYPE", 1, false},
|
||||
{SUM, "SUM", 1, false},
|
||||
{SUSPEND, "SUSPEND", 1, false},
|
||||
@ -293,13 +297,15 @@ static const TOK tokens[] = {
|
||||
{THEN, "THEN", 1, false},
|
||||
{TIME, "TIME", 2, false},
|
||||
{TIMESTAMP, "TIMESTAMP", 2, false},
|
||||
{TIMEOUT, "TIMEOUT", 2, true},
|
||||
{TO, "TO", 1, false},
|
||||
{TRAILING, "TRAILING", 2, false},
|
||||
{TRANSACTION, "TRANSACTION", 1, false},
|
||||
{TRIGGER, "TRIGGER", 1, false},
|
||||
{TRIM, "TRIM", 2, false},
|
||||
{TYPE, "TYPE", 2, false},
|
||||
{TYPE, "TYPE", 2, true},
|
||||
{UNCOMMITTED, "UNCOMMITTED", 1, false},
|
||||
{UNDO, "UNDO", 2, true},
|
||||
{UNION, "UNION", 1, false},
|
||||
{UNIQUE, "UNIQUE", 1, false},
|
||||
{UPDATE, "UPDATE", 1, false},
|
||||
@ -314,7 +320,7 @@ static const TOK tokens[] = {
|
||||
{VARYING, "VARYING", 1, false},
|
||||
{VIEW, "VIEW", 1, false},
|
||||
{WAIT, "WAIT", 1, false},
|
||||
{WEEKDAY, "WEEKDAY", 2, false},
|
||||
{WEEKDAY, "WEEKDAY", 2, true},
|
||||
{WHEN, "WHEN", 1, false},
|
||||
{WHERE, "WHERE", 1, false},
|
||||
{WHILE, "WHILE", 1, false},
|
||||
@ -322,7 +328,7 @@ static const TOK tokens[] = {
|
||||
{WORK, "WORK", 1, false},
|
||||
{WRITE, "WRITE", 1, false},
|
||||
{YEAR, "YEAR", 2, false},
|
||||
{YEARDAY, "YEARDAY", 2, false},
|
||||
{YEARDAY, "YEARDAY", 2, true},
|
||||
{NOT_LSS, "^<", 1, false}, // Alias of !<
|
||||
{NEQ, "^=", 1, false}, // Alias of !=
|
||||
{NOT_GTR, "^>", 1, false}, // Alias of !>
|
||||
|
@ -339,7 +339,9 @@ enum nod_t
|
||||
nod_strlen,
|
||||
nod_trim,
|
||||
nod_returning,
|
||||
nod_redef_trigger
|
||||
nod_redef_trigger,
|
||||
nod_tra_misc,
|
||||
nod_lock_timeout
|
||||
};
|
||||
|
||||
typedef nod_t NOD_TYPE;
|
||||
@ -363,47 +365,51 @@ public:
|
||||
|
||||
// values of flags
|
||||
enum nod_flags_vals {
|
||||
NOD_AGG_DISTINCT = 1,
|
||||
NOD_AGG_DISTINCT = 1, // nod_agg_...
|
||||
|
||||
NOD_UNION_ALL = 1,
|
||||
NOD_UNION_ALL = 1, // nod_list
|
||||
|
||||
NOD_READ_ONLY = 1,
|
||||
NOD_READ_ONLY = 1, // nod_access
|
||||
NOD_READ_WRITE = 2,
|
||||
|
||||
NOD_WAIT = 1,
|
||||
NOD_WAIT = 1, // nod_wait
|
||||
NOD_NO_WAIT = 2,
|
||||
|
||||
NOD_VERSION = 1,
|
||||
NOD_VERSION = 1, // nod_version
|
||||
NOD_NO_VERSION = 2,
|
||||
|
||||
NOD_CONCURRENCY = 1,
|
||||
NOD_CONCURRENCY = 1, // nod_isolation
|
||||
NOD_CONSISTENCY = 2,
|
||||
NOD_READ_COMMITTED = 4,
|
||||
|
||||
NOD_SHARED = 1,
|
||||
NOD_SHARED = 1, // nod_lock_mode
|
||||
NOD_PROTECTED = 2,
|
||||
NOD_READ = 4,
|
||||
NOD_WRITE = 8,
|
||||
|
||||
NOD_NO_AUTO_UNDO = 1, // nod_tra_misc
|
||||
NOD_IGNORE_LIMBO = 2,
|
||||
NOD_RESTART_REQUESTS = 4,
|
||||
|
||||
NOD_NULLS_FIRST = 1,
|
||||
NOD_NULLS_FIRST = 1, // nod_order
|
||||
NOD_NULLS_LAST = 2,
|
||||
|
||||
REF_ACTION_CASCADE = 1,
|
||||
REF_ACTION_CASCADE = 1, // nod_ref_trig_action
|
||||
REF_ACTION_SET_DEFAULT = 2,
|
||||
REF_ACTION_SET_NULL = 4,
|
||||
REF_ACTION_NONE = 8,
|
||||
// Node flag indicates that this node has a different type or result
|
||||
// depending on the SQL dialect.
|
||||
NOD_COMP_DIALECT = 16,
|
||||
NOD_COMP_DIALECT = 16, // nod_...2, see MAKE_desc
|
||||
|
||||
NOD_SELECT_EXPR_SINGLETON = 1,
|
||||
NOD_SELECT_EXPR_SINGLETON = 1, // nod_select_expr
|
||||
NOD_SELECT_EXPR_VALUE = 2,
|
||||
|
||||
NOD_CURSOR_EXPLICIT = 1,
|
||||
NOD_CURSOR_EXPLICIT = 1, // nod_cursor
|
||||
NOD_CURSOR_FOR = 2,
|
||||
NOD_CURSOR_ALL = USHORT(-1U),
|
||||
|
||||
NOD_DT_IGNORE_COLUMN_CHECK = 1
|
||||
NOD_DT_IGNORE_COLUMN_CHECK = 1 // nod_cursor, see pass1_cursor_name
|
||||
};
|
||||
|
||||
// Parameters to MAKE_constant
|
||||
|
16761
src/dsql/parse.cpp
16761
src/dsql/parse.cpp
File diff suppressed because it is too large
Load Diff
@ -519,6 +519,11 @@ static LexerState lex;
|
||||
%token TRAILING
|
||||
%token TRIM
|
||||
%token RETURNING
|
||||
%token IGNORE
|
||||
%token LIMBO
|
||||
%token UNDO
|
||||
%token REQUESTS
|
||||
%token TIMEOUT
|
||||
|
||||
/* precedence declarations for expression evaluation */
|
||||
|
||||
@ -2766,6 +2771,8 @@ tran_opt_list : tran_opt
|
||||
tran_opt : access_mode
|
||||
| lock_wait
|
||||
| isolation_mode
|
||||
| tra_misc_options
|
||||
| tra_timeout
|
||||
| tbl_reserve_options
|
||||
;
|
||||
|
||||
@ -2810,6 +2817,18 @@ version_mode : VERSION
|
||||
{ $$ = 0; }
|
||||
;
|
||||
|
||||
tra_misc_options: NO AUTO UNDO
|
||||
{ $$ = make_flag_node(nod_tra_misc, NOD_NO_AUTO_UNDO, 0, NULL); }
|
||||
| IGNORE LIMBO
|
||||
{ $$ = make_flag_node(nod_tra_misc, NOD_IGNORE_LIMBO, 0, NULL); }
|
||||
| RESTART REQUESTS
|
||||
{ $$ = make_flag_node(nod_tra_misc, NOD_RESTART_REQUESTS, 0, NULL); }
|
||||
;
|
||||
|
||||
tra_timeout: LOCK TIMEOUT nonneg_short_integer
|
||||
{ $$ = make_node(nod_lock_timeout, 1, MAKE_constant ((dsql_str*) $3, CONSTANT_SLONG)); }
|
||||
;
|
||||
|
||||
tbl_reserve_options: RESERVING restr_list
|
||||
{ $$ = make_node (nod_reserve, 1, make_list ($2)); }
|
||||
;
|
||||
@ -4318,6 +4337,11 @@ non_reserved_word :
|
||||
| RESTART
|
||||
| COLLATION
|
||||
| RETURNING
|
||||
| IGNORE
|
||||
| LIMBO
|
||||
| UNDO
|
||||
| REQUESTS
|
||||
| TIMEOUT
|
||||
;
|
||||
|
||||
%%
|
||||
|
Loading…
Reference in New Issue
Block a user