8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 10:00:38 +01:00

Merging changes from skidder branch - explicit locks, savepoints, build system changes

This commit is contained in:
skidder 2002-10-29 20:20:44 +00:00
parent 595caf5cf0
commit 8e6622a20e
38 changed files with 6421 additions and 5692 deletions

View File

@ -0,0 +1,96 @@
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# You may obtain a copy of the Licence at
# http://www.gnu.org/licences/lgpl.html
#
# As a special exception this file can also be included in modules
# with other source code as long as that source code has been
# released under an Open Source Initiative certificed licence.
# More information about OSI certification can be found at:
# http://www.opensource.org
#
# This module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public Licence for more details.
#
# This module was created by members of the firebird development
# team. All individual contributions remain the Copyright (C) of
# those individuals and all rights are reserved. Contributors to
# this file are either listed below or can be obtained from a CVS
# history command.
#
# Created by: Nickolay Samofatov <skidder@bssys.com>
#
# Contributor(s):
#
#
# $Id: Makefile.in.codes,v 1.2 2002-10-29 20:20:09 skidder Exp $
#
ROOT=..
ObjModuleName=codes
include $(ROOT)/gen/make.platform
include $(ROOT)/gen/make.rules
include $(ROOT)/gen/make.defaults
include $(ROOT)/gen/make.shared.variables
@SET_MAKE@
#____________________________________________________________________________
#
# Rebuild the codes generates in the src/jrd/boot_codes directory
# this target updates the values stored in the source path if they are
# different to the newly generated entries.
#
# There are also blrtable.h and ids.h which are generated as well.
# Regeneration is a manual thing, and you will need to
.PHONY: generated_headers
#CODES_OutFiles= gds_codes.pas gds_codes.ftn codes.h iberror.h codetext.h \
# msgs.h rdb_codes.h sql_code.h msg_facs.h
#CODES_Results=$(addprefix include/gen/, $(CODES_OutFiles))
CODES_Sources = jrd/codes.epp
CODES_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(CODES_Sources))))
BLRTABLE_Sources = jrd/blrtable.cpp
BLRTABLE_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(BLRTABLE_Sources))))
AllObjects = $(CODES_Objects) $(BLRTABLE_Objects)
Dependencies = $(AllObjects:.o=.d)
generated_headers: build_codes include/gen/blrtable.h include/gen/ids.h
# Rebuild error codes
build_codes: $(BIN)/codes msg.gdb
$(BIN)/codes include/gen
$(SRC)/jrd/codes.cpp: $(SRC)/jrd/codes.epp
$(GPRE_CURRENT) $(GPRE_FLAGS) $< $@
$(BIN)/codes: $(CODES_Objects) $(LIBFBCOMMON_A) $(LIBFBSTATIC_A)
$(CXX) $(LINK_OPTS) $(CODES_Objects) -o $@ -L $(LIB) -lfbstatic -lfbcommon $(LINK_LIBS)
# Rebuild blrtable.h
./include/gen/blrtable.h: $(BIN)/blrtable
$(BIN)/blrtable > include/gen/blrtable.h
$(BIN)/blrtable: $(BLRTABLE_Objects)
$(CXX) $(LINK_OPTS) $(BLRTABLE_Objects) -o $@ -L $(LIB) -lfbstatic -lfbcommon $(LINK_LIBS)
# Rebuild ids.h
./include/gen/ids.h: jrd/ids.m jrd/relations.h
m4 $< > include/gen/ids.h
include $(ROOT)/gen/make.shared.targets
-include $(Dependencies)

View File

@ -27,7 +27,7 @@
# Contributor(s):
#
#
# $Id: Makefile.in.firebird,v 1.11 2002-10-10 06:47:05 eku Exp $
# $Id: Makefile.in.firebird,v 1.12 2002-10-29 20:20:10 skidder Exp $
#
ROOT=..
@ -237,6 +237,7 @@ lock_mgr :
#--------------------------------------------------------------------------
#Phase2: We can now start build some of the static utilities needed to build
# an empty database (lock manager and create_db). Then we rebuild all the
@ -297,11 +298,15 @@ isc4.gdb: gdef isql # build the security database
# earlier, then perhaps we could build the jrdlib in one step and include
# the security bits and pieces.
.PHONY: ref_databases msgs msgs_intl intl extlib includes
.PHONY: ref_databases msgs msgs_intl generated_headers intl extlib includes
basic_targets: ref_databases msgs msgs_intl intl extlib includes examples \
basic_targets: ref_databases msgs msgs_intl generated_headers intl extlib includes examples \
otherfiles
# hack to make code regeneration work
generated_headers :
$(MAKE) -f $(MAKE_ROOT)/Makefile.codes $@
msgs: # messages file for user $(FIREBIRD)/firebird.msg
$(MAKE) -f $(MAKE_ROOT)/Makefile.msgs $@

View File

@ -1,4 +1,4 @@
dnl $Id: configure.in,v 1.54 2002-10-16 08:38:03 eku Exp $
dnl $Id: configure.in,v 1.55 2002-10-29 20:20:05 skidder Exp $
dnl ############################# INITIALISATION ###############################
@ -317,6 +317,8 @@ mkdir -p gen/jrd
mkdir -p gen/qli
mkdir -p gen/utilities
mkdir -p gen/fbutil
mkdir -p gen/codes
mkdir -p gen/codes/jrd
mkdir -p gen/install
mkdir -p gen/install/scripts
@ -449,6 +451,7 @@ gen/make.shared.variables:${MAKE_SRC_DIR}/make.shared.variables
gen/make.shared.targets:${MAKE_SRC_DIR}/make.shared.targets
src/Makefile:${MAKE_SRC_DIR}/Makefile.in.firebird
gen/Makefile.libfbcommon:${MAKE_SRC_DIR}/Makefile.in.libfbcommon
gen/Makefile.codes:${MAKE_SRC_DIR}/Makefile.in.codes
gen/Makefile.boot.gpre:${MAKE_SRC_DIR}/Makefile.in.boot.gpre
gen/Makefile.libfbstatic:${MAKE_SRC_DIR}/Makefile.in.libfbstatic
gen/Makefile.static.gpre:${MAKE_SRC_DIR}/Makefile.in.static.gpre

View File

@ -20,7 +20,7 @@
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
* $Id: ddl.cpp,v 1.21 2002-10-06 10:51:54 dimitr Exp $
* $Id: ddl.cpp,v 1.22 2002-10-29 20:20:14 skidder Exp $
* 2001.5.20 Claudio Valderrama: Stop null pointer that leads to a crash,
* caused by incomplete yacc syntax that allows ALTER DOMAIN dom SET;
*
@ -3411,7 +3411,7 @@ static void define_view( REQ request, NOD_TYPE op)
request->req_context_number++;
select = node->nod_arg[e_view_select];
select_expr = select->nod_arg[0];
rse = PASS1_rse(request, select_expr, select->nod_arg[1]);
rse = PASS1_rse(request, select_expr, select->nod_arg[1], NULL);
// store the blr and source string for the view definition

View File

@ -26,10 +26,11 @@
* 2001.6.3 Claudio Valderrama: fixed a bad behaved loop in get_plan_info()
* and get_rsb_item() that caused a crash when plan info was requested.
* 2001.6.9 Claudio Valderrama: Added nod_del_view, nod_current_role and nod_breakleave.
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*
*/
/*
$Id: dsql.cpp,v 1.24 2002-09-28 14:03:39 dimitr Exp $
$Id: dsql.cpp,v 1.25 2002-10-29 20:20:14 skidder Exp $
*/
/**************************************************************
V4 Multi-threading changes.
@ -874,7 +875,8 @@ STATUS callback_execute_immediate( STATUS* status,
/* Other requests appear to be incorrect in this context */
long requests = (1 << REQ_INSERT) | (1 << REQ_DELETE) | (1 << REQ_UPDATE)
| (1 << REQ_DDL) | (1 << REQ_SET_GENERATOR) | (1 << REQ_EXEC_PROCEDURE);
| (1 << REQ_DDL) | (1 << REQ_SET_GENERATOR) | (1 << REQ_EXEC_PROCEDURE)
| (1 << REQ_SAVEPOINT);
if (check_for_create_database(sql_operator, len, "createdatabase") ||
check_for_create_database(sql_operator, len, "createschema"))
@ -1631,6 +1633,9 @@ STATUS GDS_DSQL_SQL_INFO_CPP( STATUS* user_status,
case REQ_SET_GENERATOR:
number = isc_info_sql_stmt_set_generator;
break;
case REQ_SAVEPOINT:
number = isc_info_sql_stmt_savepoint;
break;
default:
number = 0;
break;
@ -2880,6 +2885,7 @@ static STATUS execute_request(REQ request,
case REQ_DELETE_CURSOR:
case REQ_EMBED_SELECT:
case REQ_SET_GENERATOR:
case REQ_SAVEPOINT:
break;
}

View File

@ -25,6 +25,7 @@
* in the udf struct, so we can load the arguments and check for
* collisions between dropping and redefining the udf concurrently.
* This closes SF Bug# 409769.
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*
*/
@ -381,7 +382,7 @@ enum REQ_TYPE
REQ_UPDATE_CURSOR, REQ_DELETE_CURSOR,
REQ_COMMIT, REQ_ROLLBACK, REQ_DDL, REQ_EMBED_SELECT,
REQ_START_TRANS, REQ_GET_SEGMENT, REQ_PUT_SEGMENT, REQ_EXEC_PROCEDURE,
REQ_COMMIT_RETAIN, REQ_SET_GENERATOR
REQ_COMMIT_RETAIN, REQ_SET_GENERATOR, REQ_SAVEPOINT
};

View File

@ -247,3 +247,5 @@
#define NULLS 503
#define LAST 504
#define ROWS_AFFECTED 505
#define LOCK 506
#define SAVEPOINT 507

View File

@ -25,9 +25,11 @@
* 2002.09.28 Dmitry Yemanov: Reworked internal_info stuff, enhanced
* exception handling in SPs/triggers,
* implemented ROWS_AFFECTED system variable
* 2002.10.21 Nickolay Samofatov: Added support for explicit pessimistic locks
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
/*
$Id: gen.cpp,v 1.12 2002-09-28 14:03:39 dimitr Exp $
$Id: gen.cpp,v 1.13 2002-10-29 20:20:15 skidder Exp $
*/
#include "firebird.h"
@ -700,33 +702,46 @@ void GEN_request( REQ request, NOD node)
STUFF(blr_version4);
else
STUFF(blr_version5);
STUFF(blr_begin);
if (request->req_type == REQ_SELECT ||
request->req_type == REQ_SELECT_UPD ||
request->req_type == REQ_EMBED_SELECT) {
gen_select(request, node);
}
else {
message = request->req_send;
if (!message->msg_parameter)
request->req_send = NULL;
else {
GEN_port(request, message);
if (request->req_type != REQ_EXEC_PROCEDURE) {
STUFF(blr_receive);
STUFF(message->msg_number);
}
}
message = request->req_receive;
if (!message->msg_parameter)
request->req_receive = NULL;
else
GEN_port(request, message);
if (request->req_type == REQ_SAVEPOINT)
{
// Do not generate BEGIN..END block around savepoint statement
// to avoid breaking of savepoint logic
request->req_send = NULL;
request->req_receive = NULL;
GEN_statement(request, node);
}
}
else
{
STUFF(blr_begin);
STUFF(blr_end);
if (request->req_type == REQ_SELECT ||
request->req_type == REQ_SELECT_UPD ||
request->req_type == REQ_EMBED_SELECT) {
gen_select(request, node);
}
else {
message = request->req_send;
if (!message->msg_parameter)
request->req_send = NULL;
else {
GEN_port(request, message);
if (request->req_type != REQ_EXEC_PROCEDURE) {
STUFF(blr_receive);
STUFF(message->msg_number);
}
}
message = request->req_receive;
if (!message->msg_parameter)
request->req_receive = NULL;
else
GEN_port(request, message);
GEN_statement(request, node);
}
STUFF(blr_end);
}
STUFF(blr_eoc);
}
@ -1068,6 +1083,16 @@ void GEN_statement( REQ request, NOD node)
case nod_end_savepoint:
STUFF(blr_end_savepoint);
return;
case nod_user_savepoint:
STUFF(blr_user_savepoint);
STUFF_CSTRING(((STR)node->nod_arg[e_sav_name])->str_data);
return;
case nod_undo_savepoint:
STUFF(blr_undo_savepoint);
STUFF_CSTRING(((STR)node->nod_arg[e_sav_name])->str_data);
return;
case nod_exception_stmt:
STUFF(blr_abort);
@ -1621,6 +1646,21 @@ static void gen_for_select( REQ request, NOD for_select)
/* Build body of FOR loop */
/* Handle write locks */
NOD streams = rse->nod_arg[e_rse_streams];
CTX context = NULL;
if (!rse->nod_arg[e_rse_reduced] && streams->nod_count==1) {
NOD item = streams->nod_arg[0];
if (item && (item->nod_type == nod_relation))
context = (CTX) item->nod_arg[e_rel_context];
}
if (rse->nod_arg[e_rse_lock] && context) {
STUFF(blr_writelock);
STUFF(context->ctx_context);
}
list = rse->nod_arg[e_rse_items];
list_to = for_select->nod_arg[e_flp_into];
if (list->nod_count != list_to->nod_count)
@ -2250,7 +2290,9 @@ static void gen_select( REQ request, NOD rse)
/* Save DBKEYs for possible update later */
/* these variables are used by FOR UPDATE statement handling lower */
list = rse->nod_arg[e_rse_streams];
context = NULL;
if (!rse->nod_arg[e_rse_reduced]) {
for (ptr = list->nod_arg, end = ptr + list->nod_count; ptr < end;
@ -2340,6 +2382,13 @@ static void gen_select( REQ request, NOD rse)
/* Build body of FOR loop */
/* Add invalid usage here */
if (rse->nod_arg[e_rse_lock] && list->nod_count==1 && context) {
STUFF(blr_writelock);
STUFF(context->ctx_context);
}
STUFF(blr_assignment);
constant = 1;
gen_constant(request, &constant_desc, USE_VALUE);

View File

@ -28,7 +28,7 @@
* Contributor(s):
*
*
* $Id: keywords.cpp,v 1.8 2002-09-28 14:03:39 dimitr Exp $
* $Id: keywords.cpp,v 1.9 2002-10-29 20:20:15 skidder Exp $
*
*/
@ -191,6 +191,7 @@ static CONST TOK tokens [] = {
{NULLIF, "NULLIF", 2},
{KW_NULL, "NULL", 1},
{NULLS, "NULLS", 2},
{LOCK, "LOCK", 2},
{KW_NUMERIC, "NUMERIC", 1},
{NUM_LOG_BUFS, "NUM_LOG_BUFFERS", 1},
{OF, "OF", 1},
@ -233,6 +234,7 @@ static CONST TOK tokens [] = {
{ROLE, "ROLE", 1},
{ROLLBACK, "ROLLBACK", 1},
{ROWS_AFFECTED, "ROWS_AFFECTED", 2},
{SAVEPOINT, "SAVEPOINT", 2},
{DATABASE, "SCHEMA", 1}, /* Alias of DATABASE */
{SECOND, "SECOND", 2},
{SEGMENT, "SEGMENT", 1},

View File

@ -28,6 +28,8 @@
* 2002.07.30 Added nod_searched_case, nod_simple_case, nod_coalesce
* 2002.07.30 and constants for arguments
* 2002.08.04 Dmitry Yemanov: ALTER VIEW
* 2002.10.21 Nickolay Samofatov: Added support for explicit pessimistic locks
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
#ifndef _DSQL_NODE_H_
@ -323,7 +325,10 @@ typedef ENUM nod_t
nod_replace_procedure, /* CREATE OR ALTER PROCEDURE */
nod_replace_trigger, /* CREATE OR ALTER TRIGGER */
nod_replace_view, /* CREATE OR ALTER VIEW */
nod_redef_view /* allows silent creation/overwriting of a view */
nod_redef_view, /* allows silent creation/overwriting of a view */
nod_for_update, /* FOR UPDATE clause */
nod_user_savepoint, /* Savepoints support */
nod_undo_savepoint
} NOD_TYPE;
@ -404,6 +409,18 @@ typedef nod *NOD;
* & nod_collate.
*/
#define e_select_expr 0 /* nod_select */
#define e_select_order 1
#define e_select_update 2
#define e_select_count 4
#define e_fpd_list 0 /* nod_for_update */
#define e_fpd_lock 1
#define e_fpd_count 2
#define e_sav_name 0 /* nod_user_savepoint, nod_undo_savepoint */
#define e_sav_count 1
#define e_fld_context 0 /* nod_field */
#define e_fld_field 1
#define e_fld_indices 2
@ -468,7 +485,8 @@ typedef nod *NOD;
#define e_rse_singleton 6
#define e_rse_plan 7
#define e_rse_skip 8
#define e_rse_count 9
#define e_rse_lock 9
#define e_rse_count 10
#define e_limit_skip 0 /* nod_limit */
#define e_limit_length 1

File diff suppressed because it is too large Load Diff

View File

@ -54,6 +54,8 @@
* 2002.09.28 Dmitry Yemanov: Reworked internal_info stuff, enhanced
* exception handling in SPs/triggers,
* implemented ROWS_AFFECTED system variable
* 2002.10.21 Nickolay Samofatov: Added support for explicit pessimistic locks
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
#if defined(DEV_BUILD) && defined(WIN32) && defined(SUPERSERVER)
@ -411,6 +413,8 @@ static void yyerror (TEXT *);
%token NULLS
%token LAST
%token ROWS_AFFECTED
%token LOCK
%token SAVEPOINT
/* precedence declarations for expression evaluation */
@ -461,6 +465,8 @@ statement : alter
| replace
| revoke
| rollback
| user_savepoint
| undo_savepoint
| select
| set
| update
@ -2503,6 +2509,18 @@ set_generator : SET GENERATOR symbol_generator_name TO signed_long_integer
/* transaction statements */
user_savepoint : SAVEPOINT symbol_savepoint_name
{ $$ = make_node (nod_user_savepoint, 1, $2); }
;
undo_savepoint : ROLLBACK optional_work TO optional_savepoint symbol_savepoint_name
{ $$ = make_node (nod_undo_savepoint, 1, $5); }
;
optional_savepoint : SAVEPOINT
|
;
commit : COMMIT optional_work optional_retain
{ $$ = make_node (nod_commit, 1, $3); }
;
@ -2634,7 +2652,7 @@ set_statistics : SET STATISTICS INDEX symbol_index_name
/* SELECT statement */
select : union_expr order_clause for_update_clause
{ $$ = make_node (nod_select, 3, $1, $2, $3); }
{ $$ = make_node (nod_select, 4, $1, $2, $3); }
;
union_expr : select_expr
@ -2678,8 +2696,14 @@ nulls_placement : NULLS FIRST
{ $$ = 0; }
;
for_update_clause : FOR UPDATE for_update_list
{ $$ = $3; }
lock_clause : WITH LOCK
{ $$ = make_node (nod_flag, 0, NULL); }
|
{ $$ = 0; }
;
for_update_clause : FOR UPDATE for_update_list lock_clause
{ $$ = make_node (nod_for_update, 2, $3, $4); }
|
{ $$ = 0; }
;
@ -3774,6 +3798,9 @@ symbol_variable_name : SYMBOL
symbol_view_name : SYMBOL
;
symbol_savepoint_name : SYMBOL
;
%%

View File

@ -106,7 +106,11 @@
* Modified functions pass1_field, pass1_rse, copy_field, pass1_sort.
* Functions pass1_found_aggregate and pass1_found_field added.
*
* 2002.10.21 Nickolay Samofatov: Added support for explicit pessimistic locks
*
* 2002.10.25 Dmitry Yemanov: Re-allowed plans in triggers
*
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
#include "firebird.h"
@ -170,7 +174,7 @@ static BOOLEAN pass1_found_field(NOD, USHORT, USHORT, BOOLEAN *);
static NOD pass1_insert(REQ, NOD);
static void pass1_put_args_on_stack(REQ, NOD, DLLS *, USHORT);
static NOD pass1_relation(REQ, NOD);
static NOD pass1_rse(REQ, NOD, NOD);
static NOD pass1_rse(REQ, NOD, NOD, NOD);
static NOD pass1_searched_case(REQ, NOD, USHORT);
static NOD pass1_sel_list(REQ, NOD);
static NOD pass1_simple_case(REQ, NOD, USHORT);
@ -552,7 +556,7 @@ NOD PASS1_node(REQ request, NOD input, USHORT proc_flag)
base = request->req_context;
node = MAKE_node(nod_via, e_via_count);
node->nod_arg[e_via_rse] = rse = PASS1_rse(request, input, NULL);
node->nod_arg[e_via_rse] = rse = PASS1_rse(request, input, NULL, NULL);
node->nod_arg[e_via_value_1] = rse->nod_arg[e_rse_items]->nod_arg[0];
node->nod_arg[e_via_value_2] = MAKE_node(nod_null, (int) 0);
@ -566,7 +570,7 @@ NOD PASS1_node(REQ request, NOD input, USHORT proc_flag)
case nod_singular:
base = request->req_context;
node = MAKE_node(input->nod_type, 1);
node->nod_arg[0] = PASS1_rse(request, input->nod_arg[0], NULL);
node->nod_arg[0] = PASS1_rse(request, input->nod_arg[0], NULL, NULL);
/* Finish off by cleaning up contexts */
@ -671,7 +675,7 @@ NOD PASS1_node(REQ request, NOD input, USHORT proc_flag)
node->nod_arg[0] = PASS1_node(request, input->nod_arg[0], 0);
node->nod_arg[1] = temp = MAKE_node(nod_via, e_via_count);
temp->nod_arg[e_via_rse] = rse =
PASS1_rse(request, sub2, NULL);
PASS1_rse(request, sub2, NULL, NULL);
temp->nod_arg[e_via_value_1] =
rse->nod_arg[e_rse_items]->nod_arg[0];
temp->nod_arg[e_via_value_2] = MAKE_node(nod_null, (int) 0);
@ -894,7 +898,7 @@ NOD PASS1_node(REQ request, NOD input, USHORT proc_flag)
}
NOD PASS1_rse(REQ request, NOD input, NOD order)
NOD PASS1_rse(REQ request, NOD input, NOD order, NOD update_lock)
{
/**************************************
*
@ -916,7 +920,7 @@ NOD PASS1_rse(REQ request, NOD input, NOD order)
DEV_BLKCHK(order, dsql_type_nod);
request->req_scope_level++;
node = pass1_rse(request, input, order);
node = pass1_rse(request, input, order, update_lock);
request->req_scope_level--;
return node;
@ -1314,8 +1318,10 @@ NOD PASS1_statement(REQ request, NOD input, USHORT proc_flag)
return input;
case nod_select:
node = PASS1_rse(request, input->nod_arg[0], input->nod_arg[1]);
if (input->nod_arg[2]) {
temp = input->nod_arg[e_select_update];
node = PASS1_rse(request, input->nod_arg[e_select_expr], input->nod_arg[e_select_order],
temp ? temp->nod_arg[e_fpd_list] : NULL );
if (temp) {
request->req_type = REQ_SELECT_UPD;
request->req_flags |= REQ_no_batch;
break;
@ -1368,6 +1374,11 @@ NOD PASS1_statement(REQ request, NOD input, USHORT proc_flag)
case nod_sqlcode:
case nod_gdscode:
return input;
case nod_user_savepoint:
case nod_undo_savepoint:
request->req_type = REQ_SAVEPOINT;
return input;
case nod_null:
return NULL;
@ -2613,7 +2624,7 @@ static NOD pass1_any( REQ request, NOD input, NOD_TYPE ntype)
temp->nod_arg[0] = PASS1_node(request, input->nod_arg[0], 0);
node = MAKE_node(ntype, 1);
node->nod_arg[0] = rse = PASS1_rse(request, select, NULL);
node->nod_arg[0] = rse = PASS1_rse(request, select, NULL, NULL);
/* adjust the scope level back to the sub-rse, so that
the fields in the select list will be properly recognized */
@ -3774,7 +3785,7 @@ static NOD pass1_insert( REQ request, NOD input)
/* Process SELECT expression, if present */
if (rse = input->nod_arg[e_ins_select]) {
node->nod_arg[e_sto_rse] = rse = PASS1_rse(request, rse, 0);
node->nod_arg[e_sto_rse] = rse = PASS1_rse(request, rse, 0, NULL);
values = rse->nod_arg[e_rse_items];
}
else
@ -4111,7 +4122,7 @@ static DSQL_REL pass1_base_table( REQ request, DSQL_REL relation, STR alias)
}
static NOD pass1_rse( REQ request, NOD input, NOD order)
static NOD pass1_rse( REQ request, NOD input, NOD order, NOD update_lock)
{
/**************************************
*
@ -4145,7 +4156,7 @@ static NOD pass1_rse( REQ request, NOD input, NOD order)
if (input->nod_type == nod_list) {
if (input->nod_count == 1)
return PASS1_rse(request, input->nod_arg[0], order);
return PASS1_rse(request, input->nod_arg[0], order, update_lock);
else
return pass1_union(request, input, order);
}
@ -4155,6 +4166,7 @@ static NOD pass1_rse( REQ request, NOD input, NOD order)
parent_context = NULL;
parent_rse = NULL;
rse = target_rse = MAKE_node(nod_rse, e_rse_count);
rse->nod_arg[e_rse_lock] = update_lock;
rse->nod_arg[e_rse_streams] =
PASS1_node(request, input->nod_arg[e_sel_from], 0);
@ -4791,7 +4803,7 @@ static NOD pass1_union( REQ request, NOD input, NOD order_list)
base = request->req_context;
for (ptr = input->nod_arg, end = ptr + input->nod_count; ptr < end;
ptr++, uptr++) {
*uptr = PASS1_rse(request, *ptr, 0);
*uptr = PASS1_rse(request, *ptr, 0, NULL);
while (request->req_context != base) {
LLS_PUSH(request->req_context->lls_object, &request->req_union_context);
LLS_POP(&request->req_context);

View File

@ -26,7 +26,7 @@
extern struct ctx *PASS1_make_context(struct req *, struct nod *);
extern struct nod *PASS1_node(struct req *, struct nod *, USHORT);
extern struct nod *PASS1_rse(struct req *, struct nod *, struct nod *);
extern struct nod *PASS1_rse(struct req *, struct nod *, struct nod *, NOD update_lock);
extern struct nod *PASS1_statement(struct req *, struct nod *, USHORT);
#endif /* _DSQL_PASS1_PROTO_H_ */

View File

@ -51,7 +51,8 @@ static CONST UCHAR blr_table4 [] = {
/*161*/ (UCHAR) nod_current_timestamp, (UCHAR) nod_current_time,
/*163*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (UCHAR) nod_current_role,
/*175*/ 0, (UCHAR) nod_exec_sql, (UCHAR) nod_internal_info,
/*178*/ 0};
/*178*/ 0, (UCHAR) nod_writelock, (UCHAR) nod_user_savepoint,
/*181*/ (UCHAR) nod_undo_savepoint, 0};
static CONST UCHAR blr_table [] = {
0, (UCHAR) nod_assignment, (UCHAR) nod_list, (UCHAR) nod_dcl_variable,
/* 4*/ (UCHAR) nod_message, (UCHAR) nod_erase, (UCHAR) nod_for,
@ -105,7 +106,8 @@ static CONST UCHAR blr_table [] = {
/*161*/ (UCHAR) nod_current_timestamp, (UCHAR) nod_current_time,
/*163*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (UCHAR) nod_current_role,
/*175*/ 0, (UCHAR) nod_exec_sql, (UCHAR) nod_internal_info,
/*178*/ 0};
/*178*/ 0, (UCHAR) nod_writelock, (UCHAR) nod_user_savepoint,
/*181*/ (UCHAR) nod_undo_savepoint, 0};
static CONST SCHAR length_table [] = {
0, e_asgn_length, 0, e_dcl_length, 0, e_erase_length,
/* 6*/ e_for_length, e_for_length, e_if_length, 1, 0, 1, e_send_length,
@ -130,7 +132,8 @@ static CONST SCHAR length_table [] = {
/*154*/ 1, 1, e_seek_length, e_find_dbkey_length, e_any_length,
/*159*/ e_extract_length, e_current_date_length, e_current_timestamp_length,
/*162*/ e_current_time_length, 0, 0, 0, 0, 0, 0, 0,
/*170*/ 0, 0, 0, 0, 1, 0, 1, 1, 0};
/*170*/ 0, 0, 0, 0, 1, 0, 1, 1, 0, e_writelock_length,
/*180*/ e_sav_length, e_sav_length, 0};
static CONST SCHAR count_table [] = {
0, 2, 0, 0, 0, 0, 3, 3, 3, 1, 0, 1, 1, 0, 1, e_sto_length - 1,
/* 16*/ 0, 1, 0, e_sto_length - 1, 1, 0, 0, 0, 0, 0, 0, 2,
@ -143,7 +146,8 @@ static CONST SCHAR count_table [] = {
/*125*/ 2, 4, 0, 0, e_blk_length, 1, 1, 1, 0, 0, 0, 1, 1, 0,
/*139*/ 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0,
/*156*/ 2, 2, 1, e_extract_count, 0, 0, 0, 0, 0, 0, 0,
/*167*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0};
/*167*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0,
/*181*/ 0, 0};
static CONST SCHAR type_table [] = {
0, STATEMENT, STATEMENT, STATEMENT, STATEMENT, STATEMENT,
/* 6*/ STATEMENT, STATEMENT, STATEMENT, STATEMENT, STATEMENT,
@ -169,7 +173,8 @@ static CONST SCHAR type_table [] = {
/*149*/ STATEMENT, STATEMENT, BOOL, BOOL, VALUE, VALUE, STATEMENT,
/*156*/ STATEMENT, STATEMENT, BOOL, VALUE, VALUE, VALUE, VALUE,
/*163*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, VALUE,
/*175*/ 0, STATEMENT, VALUE, 0};
/*175*/ 0, STATEMENT, VALUE, 0, STATEMENT, STATEMENT, STATEMENT,
/*182*/ 0};
static CONST SCHAR sub_type_table [] = {
0, VALUE, STATEMENT, OTHER, OTHER, OTHER, STATEMENT,
/* 7*/ STATEMENT, STATEMENT, STATEMENT, STATEMENT, OTHER,
@ -194,4 +199,4 @@ static CONST SCHAR sub_type_table [] = {
/*152*/ TYPE_RSE, OTHER, VALUE, STATEMENT, VALUE, STATEMENT,
/*158*/ TYPE_RSE, VALUE, OTHER, OTHER, OTHER, 0, 0, 0, 0,
/*167*/ 0, 0, 0, 0, 0, 0, 0, VALUE, 0, VALUE, VALUE,
/*178*/ 0};
/*178*/ 0, OTHER, OTHER, OTHER, 0};

View File

@ -542,6 +542,7 @@ const GDS_LONG gds_udf_name = 335544816L;
const GDS_LONG gds_bad_limit_param = 335544817L;
const GDS_LONG gds_bad_skip_param = 335544818L;
const GDS_LONG gds_io_32bit_exceeded_err = 335544819L;
const GDS_LONG gds_invalid_savepoint = 335544820L;
const GDS_LONG gds_gfix_db_name = 335740929L;
const GDS_LONG gds_gfix_invalid_sw = 335740930L;
const GDS_LONG gds_gfix_incmp_sw = 335740932L;
@ -742,7 +743,7 @@ const GDS_LONG gds_gstat_unexpected_eof = 336920580L;
const GDS_LONG gds_gstat_open_err = 336920605L;
const GDS_LONG gds_gstat_read_err = 336920606L;
const GDS_LONG gds_gstat_sysmemex = 336920607L;
const GDS_LONG gds_err_max = 699L;
const GDS_LONG gds_err_max = 700L;
#else /* c definitions */
@ -1265,6 +1266,7 @@ const GDS_LONG gds_err_max = 699L;
#define gds__bad_limit_param 335544817L
#define gds__bad_skip_param 335544818L
#define gds__io_32bit_exceeded_err 335544819L
#define gds__invalid_savepoint 335544820L
#define gds__gfix_db_name 335740929L
#define gds__gfix_invalid_sw 335740930L
#define gds__gfix_incmp_sw 335740932L
@ -1465,7 +1467,7 @@ const GDS_LONG gds_err_max = 699L;
#define gds__gstat_open_err 336920605L
#define gds__gstat_read_err 336920606L
#define gds__gstat_sysmemex 336920607L
#define gds_err_max 699
#define gds_err_max 700
#endif

View File

@ -465,16 +465,16 @@
{"must_be_dialect_2_and_up", 335544766},
{"blob_filter_exception", 335544767},
{"exception_access_violation", 335544768},
{"exception_datatype_missalignmen", 335544769},
{"exception_datatype_missalignment", 335544769},
{"exception_array_bounds_exceeded", 335544770},
{"exception_float_denormal_operan", 335544771},
{"exception_float_denormal_operand", 335544771},
{"exception_float_divide_by_zero", 335544772},
{"exception_float_inexact_result", 335544773},
{"exception_float_invalid_operand", 335544774},
{"exception_float_overflow", 335544775},
{"exception_float_stack_check", 335544776},
{"exception_float_underflow", 335544777},
{"exception_integer_divide_by_zer", 335544778},
{"exception_integer_divide_by_zero", 335544778},
{"exception_integer_overflow", 335544779},
{"exception_unknown", 335544780},
{"exception_stack_overflow", 335544781},
@ -516,6 +516,7 @@
{"bad_limit_param", 335544817},
{"bad_skip_param", 335544818},
{"io_32bit_exceeded_err", 335544819},
{"invalid_savepoint", 335544820},
{"gfix_db_name", 335740929},
{"gfix_invalid_sw", 335740930},
{"gfix_incmp_sw", 335740932},

View File

@ -1044,6 +1044,14 @@ C --
PARAMETER (GDS__generator_name = 335544815)
INTEGER*4 GDS__udf_name
PARAMETER (GDS__udf_name = 335544816)
INTEGER*4 GDS__bad_limit_param
PARAMETER (GDS__bad_limit_param = 335544817)
INTEGER*4 GDS__bad_skip_param
PARAMETER (GDS__bad_skip_param = 335544818)
INTEGER*4 GDS__io_32bit_exceeded_err
PARAMETER (GDS__io_32bit_exceeded_err = 335544819)
INTEGER*4 GDS__invalid_savepoint
PARAMETER (GDS__invalid_savepoint = 335544820)
INTEGER*4 GDS__gfix_db_name
PARAMETER (GDS__gfix_db_name = 335740929)
INTEGER*4 GDS__gfix_invalid_sw
@ -1120,6 +1128,10 @@ C --
PARAMETER (GDS__dsql_warn_precision_ambiguous1 = 336003083)
INTEGER*4 GDS__dsql_warn_precision_ambiguous2
PARAMETER (GDS__dsql_warn_precision_ambiguous2 = 336003084)
INTEGER*4 GDS__dsql_ambiguous_field_name
PARAMETER (GDS__dsql_ambiguous_field_name = 336003085)
INTEGER*4 GDS__dsql_udf_return_pos_err
PARAMETER (GDS__dsql_udf_return_pos_err = 336003086)
INTEGER*4 GDS__dyn_role_does_not_exist
PARAMETER (GDS__dyn_role_does_not_exist = 336068796)
INTEGER*4 GDS__dyn_no_grant_admin_opt
@ -1318,6 +1330,10 @@ C --
PARAMETER (GDS__gbak_not_ownr = 336331026)
INTEGER*4 GDS__gbak_mode_req
PARAMETER (GDS__gbak_mode_req = 336331031)
INTEGER*4 GDS__gbak_just_data
PARAMETER (GDS__gbak_just_data = 336331033)
INTEGER*4 GDS__gbak_data_only
PARAMETER (GDS__gbak_data_only = 336331034)
INTEGER*4 GDS__gsec_cant_open_db
PARAMETER (GDS__gsec_cant_open_db = 336723983)
INTEGER*4 GDS__gsec_switches_error

View File

@ -528,6 +528,10 @@ CONST
gds_service_not_supported = 335544814;
gds_generator_name = 335544815;
gds_udf_name = 335544816;
gds_bad_limit_param = 335544817;
gds_bad_skip_param = 335544818;
gds_io_32bit_exceeded_err = 335544819;
gds_invalid_savepoint = 335544820;
gds_gfix_db_name = 335740929;
gds_gfix_invalid_sw = 335740930;
gds_gfix_incmp_sw = 335740932;
@ -566,6 +570,8 @@ CONST
gds_dsql_warn_precision_ambiguous = 336003082;
gds_dsql_warn_precision_ambiguous1 = 336003083;
gds_dsql_warn_precision_ambiguous2 = 336003084;
gds_dsql_ambiguous_field_name = 336003085;
gds_dsql_udf_return_pos_err = 336003086;
gds_dyn_role_does_not_exist = 336068796;
gds_dyn_no_grant_admin_opt = 336068797;
gds_dyn_user_not_role_member = 336068798;
@ -665,6 +671,8 @@ CONST
gds_gbak_svc_name_missing = 336331025;
gds_gbak_not_ownr = 336331026;
gds_gbak_mode_req = 336331031;
gds_gbak_just_data = 336331033;
gds_gbak_data_only = 336331034;
gds_gsec_cant_open_db = 336723983;
gds_gsec_switches_error = 336723984;
gds_gsec_no_op_spec = 336723985;

View File

@ -552,6 +552,7 @@
#define isc_bad_limit_param 335544817L
#define isc_bad_skip_param 335544818L
#define isc_io_32bit_exceeded_err 335544819L
#define isc_invalid_savepoint 335544820L
#define isc_gfix_db_name 335740929L
#define isc_gfix_invalid_sw 335740930L
#define isc_gfix_incmp_sw 335740932L
@ -752,6 +753,6 @@
#define isc_gstat_open_err 336920605L
#define isc_gstat_read_err 336920606L
#define isc_gstat_sysmemex 336920607L
#define isc_err_max 699
#define isc_err_max 700
#endif /* JRD_GEN_IBERROR_H */

View File

@ -169,7 +169,7 @@
"transaction marked invalid by I/O error", /*149, trans_invalid */
"cache buffer for page %ld invalid", /*150, buf_invalid */
"there is no index in table %s with id %d", /*151, indexnotdefined */
"Your user name and password are not defined. Ask your database administrator to set up an InterBase login.", /*152, login */
"Your user name and password are not defined. Ask your database administrator to set up a Firebird login.", /*152, login */
"invalid bookmark handle", /*153, invalid_bookmark */
"invalid lock level %d", /*154, bad_lock_level */
"lock on table %s conflicts with existing lock", /*155, relation_lock */
@ -219,11 +219,11 @@
"restart shared cache manager", /*198, cache_restart */
"invalid lock handle", /*199, bad_lock_handle */
"long-term journaling already enabled", /*200, jrn_present */
"Unable to roll over; please see InterBase log.", /*201, wal_err_rollover2 */
"WAL I/O error. Please see InterBase log.", /*202, wal_err_logwrite */
"WAL writer - Journal server communication error. Please see InterBase log.", /*203, wal_err_jrn_comm */
"WAL buffers cannot be increased. Please see InterBase log.", /*204, wal_err_expansion */
"WAL setup error. Please see InterBase log.", /*205, wal_err_setup */
"Unable to roll over please see Firebird log.", /*201, wal_err_rollover2 */
"WAL I/O error. Please see Firebird log.", /*202, wal_err_logwrite */
"WAL writer - Journal server communication error. Please see Firebird log.", /*203, wal_err_jrn_comm */
"WAL buffers cannot be increased. Please see Firebird log.", /*204, wal_err_expansion */
"WAL setup error. Please see Firebird log.", /*205, wal_err_setup */
"WAL writer synchronization error for the database %s", /*206, wal_err_ww_sync */
"Cannot start WAL writer for the database %s", /*207, wal_err_ww_start */
"database %s shutdown", /*208, shutdown */
@ -387,7 +387,7 @@
"journal file wrong format", /*366, jrn_format_err */
"intermediate journal file full", /*367, jrn_file_full */
"The prepare statement identifies a prepare statement with an open cursor", /*368, dsql_open_cursor_request */
"InterBase error", /*369, ib_error */
"Firebird error", /*369, ib_error */
"Cache redefined", /*370, cache_redef */
"Insufficient memory to allocate page buffer cache", /*371, cache_too_small */
"Log redefined", /*372, log_redef */
@ -443,7 +443,7 @@
"User cannot write to RDB$USER_PRIVILEGES", /*422, no_write_user_priv */
"token size exceeds limit", /*423, token_too_long */
"Maximum user count exceeded. Contact your database administrator.", /*424, max_att_exceeded */
"Your login %s is same as one of the SQL role name. Ask your database administrator to set up a valid InterBase login.", /*425, login_same_as_role_name */
"Your login %s is same as one of the SQL role name. Ask your database administrator to set up a valid Firebird login.", /*425, login_same_as_role_name */
"\"REFERENCES table\" without \"(column)\" requires PRIMARY KEY on referenced table", /*426, reftable_requires_pk */
"The username entered is too long. Maximum length is 31 bytes.", /*427, usrname_too_long */
"The password specified is too long. Maximum length is 8 bytes.", /*428, password_too_long */
@ -515,199 +515,207 @@
"Services functionality will be supported in a later version of the product", /*494, service_not_supported */
"GENERATOR %s", /*495, generator_name */
"UDF %s", /*496, udf_name */
"data base file name (%s) already given", /*497, gfix_db_name */
"invalid switch %s", /*498, gfix_invalid_sw */
"incompatible switch combination", /*499, gfix_incmp_sw */
"replay log pathname required", /*500, gfix_replay_req */
"number of page buffers for cache required", /*501, gfix_pgbuf_req */
"numeric value required", /*502, gfix_val_req */
"positive numeric value required", /*503, gfix_pval_req */
"number of transactions per sweep required", /*504, gfix_trn_req */
"\"full\" or \"reserve\" required", /*505, gfix_full_req */
"user name required", /*506, gfix_usrname_req */
"password required", /*507, gfix_pass_req */
"subsystem name", /*508, gfix_subs_name */
"\"wal\" required", /*509, gfix_wal_req */
"number of seconds required", /*510, gfix_sec_req */
"numeric value between 0 and 32767 inclusive required", /*511, gfix_nval_req */
"must specify type of shutdown", /*512, gfix_type_shut */
"please retry, specifying an option", /*513, gfix_retry */
"please retry, giving a database name", /*514, gfix_retry_db */
"internal block exceeds maximum size", /*515, gfix_exceed_max */
"corrupt pool", /*516, gfix_corrupt_pool */
"virtual memory exhausted", /*517, gfix_mem_exhausted */
"bad pool id", /*518, gfix_bad_pool */
"Transaction state %d not in valid range.", /*519, gfix_trn_not_valid */
"unexpected end of input", /*520, gfix_unexp_eoi */
"failed to reconnect to a transaction in database %s", /*521, gfix_recon_fail */
"Transaction description item unknown", /*522, gfix_trn_unknown */
"\"read_only\" or \"read_write\" required", /*523, gfix_mode_req */
" -sql_dialect set database dialect n", /*524, gfix_opt_SQL_dialect */
"Cannot SELECT RDB$DB_KEY from a stored procedure.", /*525, dsql_dbkey_from_non_table */
"Precision 10 to 18 changed from DOUBLE PRECISION in SQL dialect 1 to 64-bit scaled integer in SQL dialect 3", /*526, dsql_transitional_numeric */
"Use of %s expression that returns different results in dialect 1 and dialect 3", /*527, dsql_dialect_warning_expr */
"Database SQL dialect %d does not support reference to %s datatype", /*528, sql_db_dialect_dtype_unsupport */
"DB dialect %d and client dialect %d conflict with respect to numeric precision %d.", /*529, isc_sql_dialect_conflict_num */
"WARNING: Numeric literal %s is interpreted as a floating-point", /*530, dsql_warning_number_ambiguous */
"value in SQL dialect 1, but as an exact numeric value in SQL dialect 3.", /*531, dsql_warning_number_ambiguous1 */
"WARNING: NUMERIC and DECIMAL fields with precision 10 or greater are stored", /*532, dsql_warn_precision_ambiguous */
"as approximate floating-point values in SQL dialect 1, but as 64-bit", /*533, dsql_warn_precision_ambiguous1 */
"integers in SQL dialect 3.", /*534, dsql_warn_precision_ambiguous2 */
"SQL role %s does not exist", /*535, dyn_role_does_not_exist */
"user %s has no grant admin option on SQL role %s", /*536, dyn_no_grant_admin_opt */
"user %s is not a member of SQL role %s", /*537, dyn_user_not_role_member */
"%s is not the owner of SQL role %s", /*538, dyn_delete_role_failed */
"%s is a SQL role and not a user", /*539, dyn_grant_role_to_user */
"user name %s could not be used for SQL role", /*540, dyn_inv_sql_role_name */
"SQL role %s already exists", /*541, dyn_dup_sql_role */
"keyword %s can not be used as a SQL role name", /*542, dyn_kywd_spec_for_role */
"SQL roles are not supported in on older versions of the database. A backup and restore of the database is required.", /*543, dyn_roles_not_supported */
"Cannot rename domain %s to %s. A domain with that name already exists.", /*544, dyn_domain_name_exists */
"Cannot rename column %s to %s. A column with that name already exists in table %s.", /*545, dyn_field_name_exists */
"Column %s from table %s is referenced in %s", /*546, dyn_dependency_exists */
"Cannot change datatype for column %s. Changing datatype is not supported for BLOB or ARRAY columns.", /*547, dyn_dtype_invalid */
"New size specified for column %s must be at least %d characters.", /*548, dyn_char_fld_too_small */
"Cannot change datatype for %s. Conversion from base type %s to %s is not supported.", /*549, dyn_invalid_dtype_conversion */
"Cannot change datatype for column %s from a character type to a non-character type.", /*550, dyn_dtype_conv_invalid */
"Zero length identifiers are not allowed", /*551, dyn_zero_len_id */
"found unknown switch", /*552, gbak_unknown_switch */
"page size parameter missing", /*553, gbak_page_size_missing */
"Page size specified (%ld) greater than limit (8192 bytes)", /*554, gbak_page_size_toobig */
"redirect location for output is not specified", /*555, gbak_redir_ouput_missing */
"conflicting switches for backup/restore", /*556, gbak_switches_conflict */
"device type %s not known", /*557, gbak_unknown_device */
"protection is not there yet", /*558, gbak_no_protection */
"page size is allowed only on restore or create", /*559, gbak_page_size_not_allowed */
"multiple sources or destinations specified", /*560, gbak_multi_source_dest */
"requires both input and output filenames", /*561, gbak_filename_missing */
"input and output have the same name. Disallowed.", /*562, gbak_dup_inout_names */
"expected page size, encountered \"%s\"", /*563, gbak_inv_page_size */
"REPLACE specified, but the first file %s is a database", /*564, gbak_db_specified */
"database %s already exists. To replace it, use the -R switch", /*565, gbak_db_exists */
"device type not specified", /*566, gbak_unk_device */
"gds_$blob_info failed", /*567, gbak_blob_info_failed */
"do not understand BLOB INFO item %ld", /*568, gbak_unk_blob_item */
"gds_$get_segment failed", /*569, gbak_get_seg_failed */
"gds_$close_blob failed", /*570, gbak_close_blob_failed */
"gds_$open_blob failed", /*571, gbak_open_blob_failed */
"Failed in put_blr_gen_id", /*572, gbak_put_blr_gen_id_failed */
"data type %ld not understood", /*573, gbak_unk_type */
"gds_$compile_request failed", /*574, gbak_comp_req_failed */
"gds_$start_request failed", /*575, gbak_start_req_failed */
" gds_$receive failed", /*576, gbak_rec_failed */
"gds_$release_request failed", /*577, gbak_rel_req_failed */
" gds_$database_info failed", /*578, gbak_db_info_failed */
"Expected database description record", /*579, gbak_no_db_desc */
"failed to create database %s", /*580, gbak_db_create_failed */
"RESTORE: decompression length error", /*581, gbak_decomp_len_error */
"cannot find table %s", /*582, gbak_tbl_missing */
"Cannot find column for BLOB", /*583, gbak_blob_col_missing */
"gds_$create_blob failed", /*584, gbak_create_blob_failed */
"gds_$put_segment failed", /*585, gbak_put_seg_failed */
"expected record length", /*586, gbak_rec_len_exp */
"wrong length record, expected %ld encountered %ld", /*587, gbak_inv_rec_len */
"expected data attribute", /*588, gbak_exp_data_type */
"Failed in store_blr_gen_id", /*589, gbak_gen_id_failed */
"do not recognize record type %ld", /*590, gbak_unk_rec_type */
"Expected backup version 1, 2, or 3. Found %ld", /*591, gbak_inv_bkup_ver */
"expected backup description record", /*592, gbak_missing_bkup_desc */
"string truncated", /*593, gbak_string_trunc */
" warning -- record could not be restored", /*594, gbak_cant_rest_record */
"gds_$send failed", /*595, gbak_send_failed */
"no table name for data", /*596, gbak_no_tbl_name */
"unexpected end of file on backup file", /*597, gbak_unexp_eof */
"database format %ld is too old to restore to", /*598, gbak_db_format_too_old */
"array dimension for column %s is invalid", /*599, gbak_inv_array_dim */
"Expected XDR record length", /*600, gbak_xdr_len_expected */
"cannot open backup file %s", /*601, gbak_open_bkup_error */
"cannot open status and error output file %s", /*602, gbak_open_error */
"blocking factor parameter missing", /*603, gbak_missing_block_fac */
"expected blocking factor, encountered \"%s\"", /*604, gbak_inv_block_fac */
"a blocking factor may not be used in conjunction with device CT", /*605, gbak_block_fac_specified */
"user name parameter missing", /*606, gbak_missing_username */
"password parameter missing", /*607, gbak_missing_password */
" missing parameter for the number of bytes to be skipped", /*608, gbak_missing_skipped_bytes */
"expected number of bytes to be skipped, encountered \"%s\"", /*609, gbak_inv_skipped_bytes */
"Bad attribute for RDB$CHARACTER_SETS", /*610, gbak_err_restore_charset */
"Bad attribute for RDB$COLLATIONS", /*611, gbak_err_restore_collation */
"Unexpected I/O error while reading from backup file", /*612, gbak_read_error */
"Unexpected I/O error while writing to backup file", /*613, gbak_write_error */
"could not drop database %s (database might be in use)", /*614, gbak_db_in_use */
"System memory exhausted", /*615, gbak_sysmemex */
"Bad attributes for restoring SQL role", /*616, gbak_restore_role_failed */
"SQL role parameter missing", /*617, gbak_role_op_missing */
"page buffers parameter missing", /*618, gbak_page_buffers_missing */
"expected page buffers, encountered \"%s\"", /*619, gbak_page_buffers_wrong_param */
"page buffers is allowed only on restore or create", /*620, gbak_page_buffers_restore */
"size specification either missing or incorrect for file %s", /*621, gbak_inv_size */
"file %s out of sequence", /*622, gbak_file_outof_sequence */
"can't join -- one of the files missing", /*623, gbak_join_file_missing */
" standard input is not supported when using join operation", /*624, gbak_stdin_not_supptd */
"standard output is not supported when using split operation", /*625, gbak_stdout_not_supptd */
"backup file %s might be corrupt", /*626, gbak_bkup_corrupt */
"database file specification missing", /*627, gbak_unk_db_file_spec */
"can't write a header record to file %s", /*628, gbak_hdr_write_failed */
"free disk space exhausted", /*629, gbak_disk_space_ex */
"file size given (%d) is less than minimum allowed (%d)", /*630, gbak_size_lt_min */
"service name parameter missing", /*631, gbak_svc_name_missing */
"Cannot restore over current database, must be SYSDBA or owner of the existing database.", /*632, gbak_not_ownr */
"\"read_only\" or \"read_write\" required", /*633, gbak_mode_req */
"unable to open database", /*634, gsec_cant_open_db */
"error in switch specifications", /*635, gsec_switches_error */
"no operation specified", /*636, gsec_no_op_spec */
"no user name specified", /*637, gsec_no_usr_name */
"add record error", /*638, gsec_err_add */
"modify record error", /*639, gsec_err_modify */
"find/modify record error", /*640, gsec_err_find_mod */
"record not found for user: %s", /*641, gsec_err_rec_not_found */
"delete record error", /*642, gsec_err_delete */
"find/delete record error", /*643, gsec_err_find_del */
"find/display record error", /*644, gsec_err_find_disp */
"invalid parameter, no switch defined", /*645, gsec_inv_param */
"operation already specified", /*646, gsec_op_specified */
"password already specified", /*647, gsec_pw_specified */
"uid already specified", /*648, gsec_uid_specified */
"gid already specified", /*649, gsec_gid_specified */
"project already specified", /*650, gsec_proj_specified */
"organization already specified", /*651, gsec_org_specified */
"first name already specified", /*652, gsec_fname_specified */
"middle name already specified", /*653, gsec_mname_specified */
"last name already specified", /*654, gsec_lname_specified */
"invalid switch specified", /*655, gsec_inv_switch */
"ambiguous switch specified", /*656, gsec_amb_switch */
"no operation specified for parameters", /*657, gsec_no_op_specified */
"no parameters allowed for this operation", /*658, gsec_params_not_allowed */
"incompatible switches specified", /*659, gsec_incompat_switch */
"Invalid user name (maximum 31 bytes allowed)", /*660, gsec_inv_username */
"Warning - maximum 8 significant bytes of password used", /*661, gsec_inv_pw_length */
"database already specified", /*662, gsec_db_specified */
"database administrator name already specified", /*663, gsec_db_admin_specified */
"database administrator password already specified", /*664, gsec_db_admin_pw_specified */
"SQL role name already specified", /*665, gsec_sql_role_specified */
"The license file does not exist or could not be opened for read", /*666, license_no_file */
"operation already specified", /*667, license_op_specified */
"no operation specified", /*668, license_op_missing */
"invalid switch", /*669, license_inv_switch */
"invalid switch combination", /*670, license_inv_switch_combo */
"illegal operation/switch combination", /*671, license_inv_op_combo */
"ambiguous switch", /*672, license_amb_switch */
"invalid parameter, no switch specified", /*673, license_inv_parameter */
"switch does not take any parameter", /*674, license_param_specified */
"switch requires a parameter", /*675, license_param_req */
"syntax error in command line", /*676, license_syntx_error */
"The certificate was not added. A duplicate ID exists in the license file.", /*677, license_dup_id */
"The certificate was not added. Invalid certificate ID / Key combination.", /*678, license_inv_id_key */
"The certificate was not removed. The key does not exist or corresponds to a temporary evaluation license.", /*679, license_err_remove */
"An error occurred updating the license file. Operation cancelled.", /*680, license_err_update */
"The certificate could not be validated based on the information given. Please recheck the ID and key information.", /*681, license_err_convert */
"Operation failed. An unknown error occurred.", /*682, license_err_unk */
"Add license operation failed, KEY: %s ID: %s", /*683, license_svc_err_add */
"Remove license operation failed, KEY: %s", /*684, license_svc_err_remove */
"The evaluation license has already been used on this server. You need to purchase a non-evaluation license.", /*685, license_eval_exists */
"found unknown switch", /*686, gstat_unknown_switch */
"please retry, giving a database name", /*687, gstat_retry */
"Wrong ODS version, expected %d, encountered %d", /*688, gstat_wrong_ods */
"Unexpected end of database file.", /*689, gstat_unexpected_eof */
"Can't open database file %s", /*690, gstat_open_err */
"Can't read a database page", /*691, gstat_read_err */
"System memory exhausted", /*692, gstat_sysmemex */
"Invalid parameter to FIRST. Only positive values are allowed.", /*497, bad_limit_param */
"Invalid parameter to SKIP. Only integers >= 0 are allowed.", /*498, bad_skip_param */
"File exceeded maximum size of 2GB. Add another database file or use a 64 bit I/O version of Firebird.", /*499, io_32bit_exceeded_err */
"Unable to find savepoint with name %s in transaction context", /*500, invalid_savepoint */
"data base file name (%s) already given", /*501, gfix_db_name */
"invalid switch %s", /*502, gfix_invalid_sw */
"incompatible switch combination", /*503, gfix_incmp_sw */
"replay log pathname required", /*504, gfix_replay_req */
"number of page buffers for cache required", /*505, gfix_pgbuf_req */
"numeric value required", /*506, gfix_val_req */
"positive numeric value required", /*507, gfix_pval_req */
"number of transactions per sweep required", /*508, gfix_trn_req */
"\"full\" or \"reserve\" required", /*509, gfix_full_req */
"user name required", /*510, gfix_usrname_req */
"password required", /*511, gfix_pass_req */
"subsystem name", /*512, gfix_subs_name */
"\"wal\" required", /*513, gfix_wal_req */
"number of seconds required", /*514, gfix_sec_req */
"numeric value between 0 and 32767 inclusive required", /*515, gfix_nval_req */
"must specify type of shutdown", /*516, gfix_type_shut */
"please retry, specifying an option", /*517, gfix_retry */
"please retry, giving a database name", /*518, gfix_retry_db */
"internal block exceeds maximum size", /*519, gfix_exceed_max */
"corrupt pool", /*520, gfix_corrupt_pool */
"virtual memory exhausted", /*521, gfix_mem_exhausted */
"bad pool id", /*522, gfix_bad_pool */
"Transaction state %d not in valid range.", /*523, gfix_trn_not_valid */
"unexpected end of input", /*524, gfix_unexp_eoi */
"failed to reconnect to a transaction in database %s", /*525, gfix_recon_fail */
"Transaction description item unknown", /*526, gfix_trn_unknown */
"\"read_only\" or \"read_write\" required", /*527, gfix_mode_req */
" -sql_dialect set database dialect n", /*528, gfix_opt_SQL_dialect */
"Cannot SELECT RDB$DB_KEY from a stored procedure.", /*529, dsql_dbkey_from_non_table */
"Precision 10 to 18 changed from DOUBLE PRECISION in SQL dialect 1 to 64-bit scaled integer in SQL dialect 3", /*530, dsql_transitional_numeric */
"Use of %s expression that returns different results in dialect 1 and dialect 3", /*531, dsql_dialect_warning_expr */
"Database SQL dialect %d does not support reference to %s datatype", /*532, sql_db_dialect_dtype_unsupport */
"DB dialect %d and client dialect %d conflict with respect to numeric precision %d.", /*533, isc_sql_dialect_conflict_num */
"WARNING: Numeric literal %s is interpreted as a floating-point", /*534, dsql_warning_number_ambiguous */
"value in SQL dialect 1, but as an exact numeric value in SQL dialect 3.", /*535, dsql_warning_number_ambiguous1 */
"WARNING: NUMERIC and DECIMAL fields with precision 10 or greater are stored", /*536, dsql_warn_precision_ambiguous */
"as approximate floating-point values in SQL dialect 1, but as 64-bit", /*537, dsql_warn_precision_ambiguous1 */
"integers in SQL dialect 3.", /*538, dsql_warn_precision_ambiguous2 */
"Ambiguous field name between %s and %s", /*539, dsql_ambiguous_field_name */
"External function should have return position between 1 and %d", /*540, dsql_udf_return_pos_err */
"SQL role %s does not exist", /*541, dyn_role_does_not_exist */
"user %s has no grant admin option on SQL role %s", /*542, dyn_no_grant_admin_opt */
"user %s is not a member of SQL role %s", /*543, dyn_user_not_role_member */
"%s is not the owner of SQL role %s", /*544, dyn_delete_role_failed */
"%s is a SQL role and not a user", /*545, dyn_grant_role_to_user */
"user name %s could not be used for SQL role", /*546, dyn_inv_sql_role_name */
"SQL role %s already exists", /*547, dyn_dup_sql_role */
"keyword %s can not be used as a SQL role name", /*548, dyn_kywd_spec_for_role */
"SQL roles are not supported in on older versions of the database. A backup and restore of the database is required.", /*549, dyn_roles_not_supported */
"Cannot rename domain %s to %s. A domain with that name already exists.", /*550, dyn_domain_name_exists */
"Cannot rename column %s to %s. A column with that name already exists in table %s.", /*551, dyn_field_name_exists */
"Column %s from table %s is referenced in %s", /*552, dyn_dependency_exists */
"Cannot change datatype for column %s. Changing datatype is not supported for BLOB or ARRAY columns.", /*553, dyn_dtype_invalid */
"New size specified for column %s must be at least %d characters.", /*554, dyn_char_fld_too_small */
"Cannot change datatype for %s. Conversion from base type %s to %s is not supported.", /*555, dyn_invalid_dtype_conversion */
"Cannot change datatype for column %s from a character type to a non-character type.", /*556, dyn_dtype_conv_invalid */
"Zero length identifiers are not allowed", /*557, dyn_zero_len_id */
"found unknown switch", /*558, gbak_unknown_switch */
"page size parameter missing", /*559, gbak_page_size_missing */
"Page size specified (%ld) greater than limit (8192 bytes)", /*560, gbak_page_size_toobig */
"redirect location for output is not specified", /*561, gbak_redir_ouput_missing */
"conflicting switches for backup/restore", /*562, gbak_switches_conflict */
"device type %s not known", /*563, gbak_unknown_device */
"protection is not there yet", /*564, gbak_no_protection */
"page size is allowed only on restore or create", /*565, gbak_page_size_not_allowed */
"multiple sources or destinations specified", /*566, gbak_multi_source_dest */
"requires both input and output filenames", /*567, gbak_filename_missing */
"input and output have the same name. Disallowed.", /*568, gbak_dup_inout_names */
"expected page size, encountered \"%s\"", /*569, gbak_inv_page_size */
"REPLACE specified, but the first file %s is a database", /*570, gbak_db_specified */
"database %s already exists. To replace it, use the -R switch", /*571, gbak_db_exists */
"device type not specified", /*572, gbak_unk_device */
"gds_$blob_info failed", /*573, gbak_blob_info_failed */
"do not understand BLOB INFO item %ld", /*574, gbak_unk_blob_item */
"gds_$get_segment failed", /*575, gbak_get_seg_failed */
"gds_$close_blob failed", /*576, gbak_close_blob_failed */
"gds_$open_blob failed", /*577, gbak_open_blob_failed */
"Failed in put_blr_gen_id", /*578, gbak_put_blr_gen_id_failed */
"data type %ld not understood", /*579, gbak_unk_type */
"gds_$compile_request failed", /*580, gbak_comp_req_failed */
"gds_$start_request failed", /*581, gbak_start_req_failed */
" gds_$receive failed", /*582, gbak_rec_failed */
"gds_$release_request failed", /*583, gbak_rel_req_failed */
" gds_$database_info failed", /*584, gbak_db_info_failed */
"Expected database description record", /*585, gbak_no_db_desc */
"failed to create database %s", /*586, gbak_db_create_failed */
"RESTORE: decompression length error", /*587, gbak_decomp_len_error */
"cannot find table %s", /*588, gbak_tbl_missing */
"Cannot find column for BLOB", /*589, gbak_blob_col_missing */
"gds_$create_blob failed", /*590, gbak_create_blob_failed */
"gds_$put_segment failed", /*591, gbak_put_seg_failed */
"expected record length", /*592, gbak_rec_len_exp */
"wrong length record, expected %ld encountered %ld", /*593, gbak_inv_rec_len */
"expected data attribute", /*594, gbak_exp_data_type */
"Failed in store_blr_gen_id", /*595, gbak_gen_id_failed */
"do not recognize record type %ld", /*596, gbak_unk_rec_type */
"Expected backup version 1, 2, or 3. Found %ld", /*597, gbak_inv_bkup_ver */
"expected backup description record", /*598, gbak_missing_bkup_desc */
"string truncated", /*599, gbak_string_trunc */
" warning -- record could not be restored", /*600, gbak_cant_rest_record */
"gds_$send failed", /*601, gbak_send_failed */
"no table name for data", /*602, gbak_no_tbl_name */
"unexpected end of file on backup file", /*603, gbak_unexp_eof */
"database format %ld is too old to restore to", /*604, gbak_db_format_too_old */
"array dimension for column %s is invalid", /*605, gbak_inv_array_dim */
"Expected XDR record length", /*606, gbak_xdr_len_expected */
"cannot open backup file %s", /*607, gbak_open_bkup_error */
"cannot open status and error output file %s", /*608, gbak_open_error */
"blocking factor parameter missing", /*609, gbak_missing_block_fac */
"expected blocking factor, encountered \"%s\"", /*610, gbak_inv_block_fac */
"a blocking factor may not be used in conjunction with device CT", /*611, gbak_block_fac_specified */
"user name parameter missing", /*612, gbak_missing_username */
"password parameter missing", /*613, gbak_missing_password */
" missing parameter for the number of bytes to be skipped", /*614, gbak_missing_skipped_bytes */
"expected number of bytes to be skipped, encountered \"%s\"", /*615, gbak_inv_skipped_bytes */
"Bad attribute for RDB$CHARACTER_SETS", /*616, gbak_err_restore_charset */
"Bad attribute for RDB$COLLATIONS", /*617, gbak_err_restore_collation */
"Unexpected I/O error while reading from backup file", /*618, gbak_read_error */
"Unexpected I/O error while writing to backup file", /*619, gbak_write_error */
"could not drop database %s (database might be in use)", /*620, gbak_db_in_use */
"System memory exhausted", /*621, gbak_sysmemex */
"Bad attributes for restoring SQL role", /*622, gbak_restore_role_failed */
"SQL role parameter missing", /*623, gbak_role_op_missing */
"page buffers parameter missing", /*624, gbak_page_buffers_missing */
"expected page buffers, encountered \"%s\"", /*625, gbak_page_buffers_wrong_param */
"page buffers is allowed only on restore or create", /*626, gbak_page_buffers_restore */
"size specification either missing or incorrect for file %s", /*627, gbak_inv_size */
"file %s out of sequence", /*628, gbak_file_outof_sequence */
"can't join -- one of the files missing", /*629, gbak_join_file_missing */
" standard input is not supported when using join operation", /*630, gbak_stdin_not_supptd */
"standard output is not supported when using split operation", /*631, gbak_stdout_not_supptd */
"backup file %s might be corrupt", /*632, gbak_bkup_corrupt */
"database file specification missing", /*633, gbak_unk_db_file_spec */
"can't write a header record to file %s", /*634, gbak_hdr_write_failed */
"free disk space exhausted", /*635, gbak_disk_space_ex */
"file size given (%d) is less than minimum allowed (%d)", /*636, gbak_size_lt_min */
"service name parameter missing", /*637, gbak_svc_name_missing */
"Cannot restore over current database, must be SYSDBA or owner of the existing database.", /*638, gbak_not_ownr */
"\"read_only\" or \"read_write\" required", /*639, gbak_mode_req */
"just data ignore all constraints etc.", /*640, gbak_just_data */
"restoring data only ignoring foreign key, unique, not null & other constraints", /*641, gbak_data_only */
"unable to open database", /*642, gsec_cant_open_db */
"error in switch specifications", /*643, gsec_switches_error */
"no operation specified", /*644, gsec_no_op_spec */
"no user name specified", /*645, gsec_no_usr_name */
"add record error", /*646, gsec_err_add */
"modify record error", /*647, gsec_err_modify */
"find/modify record error", /*648, gsec_err_find_mod */
"record not found for user: %s", /*649, gsec_err_rec_not_found */
"delete record error", /*650, gsec_err_delete */
"find/delete record error", /*651, gsec_err_find_del */
"find/display record error", /*652, gsec_err_find_disp */
"invalid parameter, no switch defined", /*653, gsec_inv_param */
"operation already specified", /*654, gsec_op_specified */
"password already specified", /*655, gsec_pw_specified */
"uid already specified", /*656, gsec_uid_specified */
"gid already specified", /*657, gsec_gid_specified */
"project already specified", /*658, gsec_proj_specified */
"organization already specified", /*659, gsec_org_specified */
"first name already specified", /*660, gsec_fname_specified */
"middle name already specified", /*661, gsec_mname_specified */
"last name already specified", /*662, gsec_lname_specified */
"invalid switch specified", /*663, gsec_inv_switch */
"ambiguous switch specified", /*664, gsec_amb_switch */
"no operation specified for parameters", /*665, gsec_no_op_specified */
"no parameters allowed for this operation", /*666, gsec_params_not_allowed */
"incompatible switches specified", /*667, gsec_incompat_switch */
"Invalid user name (maximum 31 bytes allowed)", /*668, gsec_inv_username */
"Warning - maximum 8 significant bytes of password used", /*669, gsec_inv_pw_length */
"database already specified", /*670, gsec_db_specified */
"database administrator name already specified", /*671, gsec_db_admin_specified */
"database administrator password already specified", /*672, gsec_db_admin_pw_specified */
"SQL role name already specified", /*673, gsec_sql_role_specified */
"The license file does not exist or could not be opened for read", /*674, license_no_file */
"operation already specified", /*675, license_op_specified */
"no operation specified", /*676, license_op_missing */
"invalid switch", /*677, license_inv_switch */
"invalid switch combination", /*678, license_inv_switch_combo */
"illegal operation/switch combination", /*679, license_inv_op_combo */
"ambiguous switch", /*680, license_amb_switch */
"invalid parameter, no switch specified", /*681, license_inv_parameter */
"switch does not take any parameter", /*682, license_param_specified */
"switch requires a parameter", /*683, license_param_req */
"syntax error in command line", /*684, license_syntx_error */
"The certificate was not added. A duplicate ID exists in the license file.", /*685, license_dup_id */
"The certificate was not added. Invalid certificate ID / Key combination.", /*686, license_inv_id_key */
"The certificate was not removed. The key does not exist or corresponds to a temporary evaluation license.", /*687, license_err_remove */
"An error occurred updating the license file. Operation cancelled.", /*688, license_err_update */
"The certificate could not be validated based on the information given. Please recheck the ID and key information.", /*689, license_err_convert */
"Operation failed. An unknown error occurred.", /*690, license_err_unk */
"Add license operation failed, KEY: %s ID: %s", /*691, license_svc_err_add */
"Remove license operation failed, KEY: %s", /*692, license_svc_err_remove */
"The evaluation license has already been used on this server. You need to purchase a non-evaluation license.", /*693, license_eval_exists */
"found unknown switch", /*694, gstat_unknown_switch */
"please retry, giving a database name", /*695, gstat_retry */
"Wrong ODS version, expected %d, encountered %d", /*696, gstat_wrong_ods */
"Unexpected end of database file.", /*697, gstat_unexpected_eof */
"Can't open database file %s", /*698, gstat_open_err */
"Can't read a database page", /*699, gstat_read_err */
"System memory exhausted", /*700, gstat_sysmemex */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -24,6 +24,8 @@
* 2002.09.28 Dmitry Yemanov: Reworked internal_info stuff, enhanced
* exception handling in SPs/triggers,
* implemented ROWS_AFFECTED system variable
* 2002.10.21 Nickolay Samofatov: Added support for explicit pessimistic locks
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
#ifndef _JRD_BLR_H_
@ -292,6 +294,12 @@
#define blr_exec_sql (unsigned char)176
#define blr_internal_info (unsigned char)177
#define blr_nullsfirst (unsigned char)178
#define blr_writelock (unsigned char)179
/* This codes are for user-defined savepoints
as opposed to the system ones defined earlier */
#define blr_user_savepoint (unsigned char)180
#define blr_undo_savepoint (unsigned char)181
#endif /* _JRD_BLR_H_ */

View File

@ -19,6 +19,8 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* 2002.10.21 Nickolay Samofatov: Added support for explicit pessimistic locks
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
#include "firebird.h"
@ -79,6 +81,9 @@ static CONST VERB verbs[] = {
PAIR(nod_loop, blr_loop, 1, 1, STATEMENT, STATEMENT),
PAIR(nod_message, blr_message, 0, 0, STATEMENT, OTHER),
PAIR(nod_modify, blr_modify, 0, 0, STATEMENT, STATEMENT),
PAIR(nod_writelock, blr_writelock, e_writelock_length, 0, STATEMENT, OTHER),
PAIR(nod_user_savepoint, blr_user_savepoint, e_sav_length, 0, STATEMENT, OTHER),
PAIR(nod_undo_savepoint, blr_undo_savepoint, e_sav_length, 0, STATEMENT, OTHER),
PAIR(nod_receive, blr_receive, e_send_length, 1, STATEMENT, STATEMENT),
PAIR(nod_select, blr_select, 0, 0, STATEMENT, STATEMENT),
PAIR(nod_send, blr_send, e_send_length, 1, STATEMENT, STATEMENT),

View File

@ -31,9 +31,11 @@
* 2002.09.28 Dmitry Yemanov: Reworked internal_info stuff, enhanced
* exception handling in SPs/triggers,
* implemented ROWS_AFFECTED system variable
* 2002.10.21 Nickolay Samofatov: Added support for explicit pessimistic locks
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
/*
$Id: cmp.cpp,v 1.14 2002-09-28 14:04:34 dimitr Exp $
$Id: cmp.cpp,v 1.15 2002-10-29 20:20:31 skidder Exp $
*/
#include "firebird.h"
@ -2408,6 +2410,15 @@ static NOD copy(
args = e_erase_length;
break;
case nod_writelock:
args = e_writelock_length;
break;
case nod_user_savepoint:
case nod_undo_savepoint:
args = e_sav_length;
break;
case nod_modify:
args = e_mod_length;
break;
@ -3170,6 +3181,11 @@ static NOD pass1(
pass1_erase(tdbb, csb, node);
break;
/* Add update privilege handling code for writelock here if needed
case nod_writelock:
break;
*/
case nod_exec_proc:
procedure = (PRC) node->nod_arg[e_esp_procedure];
post_procedure_access(tdbb, *csb, procedure);

View File

@ -30,9 +30,9 @@
* 2001.10.01 Claudio Valderrama: Enable explicit GRANT...to ROLE role_name.
* and complain if the grantee ROLE doesn't exist.
* 2001.10.06 Claudio Valderrama: Forbid "NONE" from role-related operations.
* Honor explicit USER keyword in GRANTs and REVOKEs.
*
* Honor explicit USER keyword in GRANTs and REVOKEs. *
* 2002.08.10 Dmitry Yemanov: ALTER VIEW
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
#include "firebird.h"
@ -144,7 +144,7 @@ void DYN_ddl(ATT attachment, TRA transaction, USHORT length, UCHAR * ddl)
V4_JRD_MUTEX_LOCK(dbb->dbb_mutexes + DBB_MUTX_dyn);
#endif
VIO_start_save_point(tdbb, transaction);
VIO_start_save_point(tdbb, transaction, NULL);
transaction->tra_save_point->sav_verb_count++;
DYN_execute(&gbl, &ptr, (TEXT*)NULL_PTR, (TEXT*)NULL_PTR, (TEXT*)NULL_PTR, (TEXT*)NULL_PTR, (TEXT*)NULL_PTR);

View File

@ -33,12 +33,13 @@
* exception handling in SPs/triggers,
* implemented ROWS_AFFECTED system variable
*
* 2002.10.21 Nickolay Samofatov: Added support for explicit pessimistic locks
* 2002.10.28 Sean Leyne - Code cleanup, removed obsolete "MPEXL" port
* 2002.10.28 Sean Leyne - Code cleanup, removed obsolete "DecOSF" port
*
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
/*
$Id: exe.cpp,v 1.23 2002-10-29 16:27:45 tamlin Exp $
$Id: exe.cpp,v 1.24 2002-10-29 20:20:36 skidder Exp $
*/
#include "firebird.h"
@ -127,6 +128,7 @@ static void execute_procedure(TDBB, NOD);
static REQ execute_triggers(TDBB, TRIG_VEC *, REC, REC);
static NOD looper(TDBB, REQ, NOD);
static NOD modify(TDBB, register NOD, SSHORT);
static void writelock(TDBB, register NOD);
static NOD receive_msg(TDBB, register NOD);
static void release_blobs(TDBB, REQ);
static void release_proc_save_points(REQ);
@ -627,7 +629,7 @@ void EXE_receive(TDBB tdbb,
request->req_proc_sav_point = save_sav_point;
if (!transaction->tra_save_point) {
VIO_start_save_point(tdbb, transaction);
VIO_start_save_point(tdbb, transaction, NULL);
}
}
@ -918,9 +920,15 @@ void EXE_start(TDBB tdbb, REQ request, TRA transaction)
/* Start a save point if not in middle of one */
if (transaction && (transaction != dbb->dbb_sys_trans)) {
VIO_start_save_point(tdbb, transaction);
}
// 29.10.2002 - Nickolay Samofatov
// I commented out savepoint handling logic here and below
// because I had no idea why is it needed but it added
// unnecessary overhead and prevented new savepoint logic from working.
// All insert/update/delete operations are surrounded by savepoint
// handling code at the DSQL layer.
// if (transaction && (transaction != dbb->dbb_sys_trans)) {
// VIO_start_save_point(tdbb, transaction, NULL);
// }
#ifdef WIN_NT
START_CHECK_FOR_EXCEPTIONS(NULL);
#endif
@ -931,13 +939,13 @@ void EXE_start(TDBB tdbb, REQ request, TRA transaction)
/* If any requested modify/delete/insert ops have completed, forget them */
if (transaction && (transaction != dbb->dbb_sys_trans) &&
transaction->tra_save_point &&
!transaction->tra_save_point->sav_verb_count) {
// if (transaction && (transaction != dbb->dbb_sys_trans) &&
// transaction->tra_save_point &&
// !transaction->tra_save_point->sav_verb_count) {
/* Forget about any undo for this verb */
VIO_verb_cleanup(tdbb, transaction);
}
// VIO_verb_cleanup(tdbb, transaction);
// }
}
@ -1196,7 +1204,18 @@ static NOD erase(TDBB tdbb, NOD node, SSHORT which_trig)
if (relation->rel_file)
EXT_erase(rpb, reinterpret_cast < int *>(transaction));
else if (!relation->rel_view_rse)
VIO_erase(tdbb, rpb, transaction);
// Repeat it as many times as underlying record modifies
while (TRUE) {
if (VIO_erase(tdbb, rpb, transaction)) break;
if ( !(transaction->tra_flags & TRA_read_committed) ||
(transaction->tra_flags & TRA_rec_version) ||
(transaction->tra_flags & TRA_nowait) )
{
ERR_post(isc_deadlock, isc_arg_gds, isc_update_conflict, 0);
}
rpb->rpb_stream_flags |= RPB_s_refetch;
}
/* Handle post operation trigger */
@ -1293,7 +1312,7 @@ static void execute_looper(
if (!(request->req_flags & req_proc_fetch) && request->req_transaction)
if (transaction && (transaction != dbb->dbb_sys_trans))
VIO_start_save_point(tdbb, transaction);
VIO_start_save_point(tdbb, transaction, NULL);
request->req_flags &= ~req_stall;
request->req_operation = next_state;
@ -1759,6 +1778,8 @@ static NOD looper(TDBB tdbb, REQ request, NOD in_node)
**************************************/
STA impure;
SLONG sav_number;
SAV savepoint;
SSHORT which_erase_trig = 0;
SSHORT which_sto_trig = 0;
SSHORT which_mod_trig = 0;
@ -1902,6 +1923,12 @@ static NOD looper(TDBB tdbb, REQ request, NOD in_node)
}
}
break;
case nod_writelock:
writelock(tdbb, node);
node = node->nod_parent;
request->req_operation = req::req_return;
break;
case nod_exec_proc:
if (request->req_operation == req::req_unwind) {
@ -1977,6 +2004,42 @@ static NOD looper(TDBB tdbb, REQ request, NOD in_node)
node = node->nod_parent;
}
break;
case nod_user_savepoint:
VIO_start_save_point(tdbb, transaction, (TEXT*)node->nod_arg[e_sav_name]);
node = node->nod_parent;
request->req_operation = req::req_return;
break;
case nod_undo_savepoint:
savepoint = transaction->tra_save_point;
// Find savepoint to undo
while(TRUE) {
if (!savepoint || !(savepoint->sav_flags & SAV_user))
ERR_post(gds_invalid_savepoint,
gds_arg_number, (SLONG) node->nod_arg[e_sav_name], 0);
if (!strcmp((TEXT*)node->nod_arg[e_sav_name],(TEXT*)savepoint->sav_name))
break;
savepoint = savepoint->sav_next;
}
sav_number = savepoint->sav_number;
// Actually undo the savepoint
while ( transaction->tra_save_point &&
transaction->tra_save_point->sav_number >= sav_number )
{
transaction->tra_save_point->sav_verb_count++;
VERB_CLEANUP;
}
// Now set the savepoint again to allow to return to it later
VIO_start_save_point(tdbb, transaction, (TEXT*)node->nod_arg[e_sav_name]);
node = node->nod_parent;
request->req_operation = req::req_return;
break;
case nod_start_savepoint:
switch (request->req_operation) {
@ -1984,7 +2047,7 @@ static NOD looper(TDBB tdbb, REQ request, NOD in_node)
/* Start a save point */
if (transaction != dbb->dbb_sys_trans)
VIO_start_save_point(tdbb, transaction);
VIO_start_save_point(tdbb, transaction, NULL);
default:
node = node->nod_parent;
@ -2036,7 +2099,7 @@ static NOD looper(TDBB tdbb, REQ request, NOD in_node)
case req::req_evaluate:
if (transaction != dbb->dbb_sys_trans) {
VIO_start_save_point(tdbb, transaction);
VIO_start_save_point(tdbb, transaction, NULL);
save_point = transaction->tra_save_point;
count = save_point->sav_number;
MOVE_FAST(&count,
@ -2755,7 +2818,18 @@ static NOD modify(TDBB tdbb, register NOD node, SSHORT which_trig)
REL bad_relation;
IDX_E error_code;
VIO_modify(tdbb, org_rpb, new_rpb, transaction);
// Repeat it as many times as underlying record modifies
while (TRUE) {
if (VIO_modify(tdbb, org_rpb, new_rpb, transaction)) break;
if ( !(transaction->tra_flags & TRA_read_committed) ||
(transaction->tra_flags & TRA_rec_version) ||
(transaction->tra_flags & TRA_nowait) )
{
ERR_post(isc_deadlock, isc_arg_gds, isc_update_conflict, 0);
}
org_rpb->rpb_stream_flags |= RPB_s_refetch;
}
error_code = IDX_modify(tdbb,
org_rpb,
new_rpb,
@ -2917,6 +2991,168 @@ static NOD modify(TDBB tdbb, register NOD node, SSHORT which_trig)
return node->nod_arg[e_mod_statement];
}
static void writelock(TDBB tdbb, register NOD node)
{
/**************************************
*
* w r i t e l o c k
*
**************************************
*
* Functional description
* Set write lock by making record owned by this transaction.
* Current implementation is absolutely not perfect.
* It basically works as modify, but doesn't call triggers
* better implementation would require modification in VIO code
*
**************************************/
DBB dbb;
register REQ request, trigger;
// STA impure;
FMT org_format, new_format;
SSHORT org_stream;
REC org_record, new_record;
RPB *org_rpb;
rpb new_rpb;
REL relation;
TRA transaction;
SET_TDBB(tdbb);
dbb = tdbb->tdbb_database;
BLKCHK(node, type_nod);
request = tdbb->tdbb_request;
transaction = request->req_transaction;
// impure = (STA) ((SCHAR *) request + node->nod_impure);
org_stream = (USHORT) node->nod_arg[e_writelock_stream];
org_rpb = &request->req_rpb[org_stream];
relation = org_rpb->rpb_relation;
/* If the stream was sorted, the various fields in the rpb are
probably junk. Just to make sure that everything is cool,
refetch and release the record. */
if (org_rpb->rpb_stream_flags & RPB_s_refetch) {
SLONG tid_fetch;
tid_fetch = org_rpb->rpb_transaction;
if ((!DPM_get(tdbb, org_rpb, LCK_read)) ||
(!VIO_chase_record_version(tdbb,
org_rpb,
NULL,
transaction,
reinterpret_cast<BLK>(tdbb->tdbb_default))))
{
ERR_post(gds_deadlock, gds_arg_gds, gds_update_conflict, 0);
}
VIO_data(tdbb, org_rpb,
reinterpret_cast<BLK>(tdbb->tdbb_request->req_pool));
/* If record is present, and the transaction is read committed,
* make sure the record has not been updated. Also, punt after
* VIO_data () call which will release the page.
*/
if ((transaction->tra_flags & TRA_read_committed) &&
(tid_fetch != org_rpb->rpb_transaction))
{
ERR_post(gds_deadlock, gds_arg_gds, gds_update_conflict, 0);
}
org_rpb->rpb_stream_flags &= ~RPB_s_refetch;
}
memset(&new_rpb,0,sizeof(new_rpb));
new_rpb.rpb_relation = relation;
new_format = MET_current(tdbb, relation);
new_record = VIO_record(tdbb, &new_rpb, new_format, tdbb->tdbb_default);
new_rpb.rpb_address = new_record->rec_data;
new_rpb.rpb_length = new_format->fmt_length;
new_rpb.rpb_format_number = new_format->fmt_version;
if (!(org_record = org_rpb->rpb_record)) {
org_record =
VIO_record(tdbb, org_rpb, new_format, tdbb->tdbb_default);
org_format = org_record->rec_format;
org_rpb->rpb_address = org_record->rec_data;
org_rpb->rpb_length = org_format->fmt_length;
org_rpb->rpb_format_number = org_format->fmt_version;
}
else
org_format = org_record->rec_format;
/* Copy the original record to the new record. If the format hasn't changed,
this is a simple move. If the format has changed, each field must be
fetched and moved separately, remembering to set the missing flag. */
if (new_format->fmt_version == org_format->fmt_version)
MOVE_FASTER(org_record->rec_data, new_rpb.rpb_address,
new_rpb.rpb_length);
else {
SSHORT i;
DSC org_desc, new_desc;
for (i = 0; i < new_format->fmt_count; i++) {
/* In order to "map a null to a default" value (in EVL_field()),
* the relation block is referenced.
* Reference: Bug 10116, 10424
*/
CLEAR_NULL(new_record, i);
if (EVL_field(new_rpb.rpb_relation, new_record, i, &new_desc)) {
if (EVL_field
(org_rpb->rpb_relation, org_record, i,
&org_desc)) MOV_move(&org_desc, &new_desc);
else {
SET_NULL(new_record, i);
if (new_desc.dsc_dtype) {
UCHAR *p;
USHORT n;
p = new_desc.dsc_address;
n = new_desc.dsc_length;
do
*p++ = 0;
while (--n);
}
} /* if (org_record) */
} /* if (new_record) */
} /* for (fmt_count) */
}
if (!relation->rel_view_rse && !relation->rel_file)
{
SSHORT bad_index;
REL bad_relation;
IDX_E error_code;
RLCK_reserve_relation(tdbb, transaction, relation, TRUE, TRUE);
// Repeat it as many times as underlying record modifies
while (TRUE) {
if (VIO_modify(tdbb, org_rpb, &new_rpb, transaction)) break;
if ( !(transaction->tra_flags & TRA_read_committed) ||
(transaction->tra_flags & TRA_rec_version) ||
(transaction->tra_flags & TRA_nowait) )
{
ERR_post(isc_deadlock, isc_arg_gds, isc_update_conflict, 0);
}
org_rpb->rpb_stream_flags |= RPB_s_refetch;
}
error_code = IDX_modify(tdbb,
org_rpb,
&new_rpb,
transaction,
&bad_relation,
reinterpret_cast<USHORT*>(&bad_index));
if (error_code) {
ERR_duplicate_error(error_code, bad_relation, bad_index);
}
}
}
static NOD receive_msg(TDBB tdbb, register NOD node)
{

View File

@ -24,6 +24,8 @@
* 2002.09.28 Dmitry Yemanov: Reworked internal_info stuff, enhanced
* exception handling in SPs/triggers,
* implemented ROWS_AFFECTED system variable
* 2002.10.21 Nickolay Samofatov: Added support for explicit pessimistic locks
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
#ifndef _JRD_EXE_H_
@ -258,6 +260,13 @@ typedef struct iasb {
#define e_erase_rsb 3
#define e_erase_length 4
#define e_writelock_stream 0
#define e_writelock_length 1
/* used for both nod_user_savepoint and nod_undo_savepoint */
#define e_sav_name 0
#define e_sav_length 1
#define e_mod_statement 0
#define e_mod_sub_mod 1
#define e_mod_validate 2

View File

@ -25,13 +25,12 @@
* 17-Oct-2001 Mike Nordell: CPU affinity
* 2001-04-16 Paul Beach: ISC_TIME_SECONDS_PRECISION_SCALE modified for HP10
* Compiler Compatibility
*/
/*
$Id: ibase.h,v 1.14 2002-10-24 09:01:29 eku Exp $
*
* 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete ports:
* - EPSON, XENIX, MAC (MAC_AUX), Cray and OS/2
*
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
/*
$Id: ibase.h,v 1.15 2002-10-29 20:20:38 skidder Exp $
*/
#ifndef JRD_IBASE_H
@ -2045,6 +2044,7 @@ enum info_db_provider
#define isc_info_sql_stmt_rollback 11
#define isc_info_sql_stmt_select_for_upd 12
#define isc_info_sql_stmt_set_generator 13
#define isc_info_sql_stmt_savepoint 14
/***********************************/

View File

@ -27,4 +27,4 @@ define(END_RELATION, )
define(FIELD_ODS8, )
include(relations.h)
include(jrd/relations.h)

View File

@ -19,12 +19,16 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
NODE(nod_asn_list, asn_list, "")
NODE(nod_assignment, assignment, "")
NODE(nod_dcl_variable, declare, "")
NODE(nod_erase, erase, "")
NODE(nod_writelock, writelock, "WRITELOCK")
NODE(nod_user_savepoint, user_savepoint, "SAVEPOINT")
NODE(nod_undo_savepoint, undo_savepoint, "ROLLBACK TO SAVEPOINT")
NODE(nod_fetch, fetch, "")
NODE(nod_for, for, "")
NODE(nod_handler, handler, "")

View File

@ -26,13 +26,13 @@
* 2002.09.28 Dmitry Yemanov: Reworked internal_info stuff, enhanced
* exception handling in SPs/triggers,
* implemented ROWS_AFFECTED system variable
*
* 2002.10.21 Nickolay Samofatov: Added support for explicit pessimistic locks
* 2002.10.28 Sean Leyne - Code cleanup, removed obsolete "MPEXL" port
* 2002.10.29 Mike Nordell - Fixed breakage.
*
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
/*
$Id: par.cpp,v 1.15 2002-10-29 16:27:45 tamlin Exp $
$Id: par.cpp,v 1.16 2002-10-29 20:20:38 skidder Exp $
*/
#include "firebird.h"
@ -2253,6 +2253,7 @@ static NOD parse(TDBB tdbb, register CSB * csb, USHORT expected)
register NOD node, *arg;
SSHORT sub_type, operator_;
USHORT n;
TEXT name[32];
SET_TDBB(tdbb);
@ -2260,7 +2261,7 @@ static NOD parse(TDBB tdbb, register CSB * csb, USHORT expected)
if (! (operator_ >= 0 &&
operator_ < sizeof(type_table) / sizeof(type_table[0]))) {
syntax_error(*csb, "Invalid BLR code");
syntax_error(*csb, "valid BLR code");
}
sub_type = sub_type_table[operator_];
@ -2362,6 +2363,12 @@ static NOD parse(TDBB tdbb, register CSB * csb, USHORT expected)
case blr_start_savepoint:
case blr_end_savepoint:
break;
case blr_user_savepoint:
case blr_undo_savepoint:
par_name(csb, name);
*arg++ = (NOD)ALL_cstring(name);
break;
case blr_store:
case blr_store2:
@ -2394,6 +2401,14 @@ static NOD parse(TDBB tdbb, register CSB * csb, USHORT expected)
node->nod_arg[e_erase_stream] =
(NOD) (SLONG) (*csb)->csb_rpt[n].csb_stream;
break;
case blr_writelock:
n = BLR_BYTE;
if (n >= (*csb)->csb_count)
error(*csb, gds_ctxnotdef, 0);
node->nod_arg[e_writelock_stream] =
(NOD) (SLONG) (*csb)->csb_rpt[n].csb_stream;
break;
case blr_modify:
node = par_modify(tdbb, csb);

View File

@ -22,6 +22,7 @@
* 2001.07.06 Sean Leyne - Code Cleanup, removed "#ifdef READONLY_DATABASE"
* conditionals, as the engine now fully supports
* readonly databases.
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
#include "firebird.h"
@ -1153,9 +1154,19 @@ void TRA_rollback(TDBB tdbb, TRA transaction, USHORT retaining_flag)
/* If there is a transaction-level savepoint, then use that to undo
this transaction's work and mark it committed in the TIP page
instead (avoids a need for a database sweep). */
BOOLEAN tran_sav = FALSE;
for (SAV temp = transaction->tra_save_point; temp; temp=temp->sav_next)
if (temp->sav_flags & SAV_trans_level)
tran_sav = TRUE;
if (transaction->tra_save_point)
if (tran_sav)
{
/* Undo all user savepoints*/
while (transaction->tra_save_point->sav_flags & SAV_user) {
++transaction->tra_save_point->sav_verb_count; /* cause undo */
VIO_verb_cleanup(tdbb, transaction);
}
if (!(transaction->tra_save_point->sav_flags & SAV_trans_level))
BUGCHECK(287); /* Too many savepoints */
@ -1703,7 +1714,7 @@ TRA TRA_start(TDBB tdbb, int tpb_length, SCHAR * tpb)
if ((trans != dbb->dbb_sys_trans) &&
!(trans->tra_flags & TRA_no_auto_undo)) {
VIO_start_save_point(tdbb, trans);
VIO_start_save_point(tdbb, trans, NULL);
trans->tra_save_point->sav_flags |= SAV_trans_level;
}
@ -2702,11 +2713,15 @@ static void retain_context(TDBB tdbb, TRA transaction, USHORT commit)
'transaction' control block: get rid of the transaction-level
savepoint and possibly start a new transaction-level savepoint. */
// Close all user savepoints. This may happen only at commit time
while (transaction->tra_save_point && transaction->tra_save_point->sav_flags & SAV_user)
VIO_verb_cleanup(tdbb, transaction);
if (transaction->tra_save_point) {
if (!(transaction->tra_save_point->sav_flags & SAV_trans_level))
BUGCHECK(287); /* Too many savepoints */
VIO_verb_cleanup(tdbb, transaction); /* get rid of savepoint */
VIO_start_save_point(tdbb, transaction); /* start new savepoint */
VIO_start_save_point(tdbb, transaction, NULL); /* start new savepoint */
transaction->tra_save_point->sav_flags |= SAV_trans_level;
}

View File

@ -21,6 +21,7 @@
* Contributor(s): ______________________________________.
* 2001.6.25 Claudio Valderrama: add dfw_delete_generator and dfw_delete_udf
* to the dfw_t enumeration.
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
#ifndef JRD_TRA_H
@ -131,6 +132,7 @@ class sav : public pool_alloc<type_sav>
SLONG sav_number; /* save point number */
struct sav *sav_next;
USHORT sav_flags;
TEXT sav_name[32]; /* Savepoint name */
};
typedef sav *SAV;
@ -138,6 +140,7 @@ typedef sav *SAV;
#define SAV_trans_level 1 /* savepoint was started by TRA_start */
#define SAV_event_post 2 /* event posted in the save point */
#define SAV_user 4 /* named user savepoint as opposed to system ones */
/* Deferred work blocks are used by the meta data handler to keep track
of work deferred to commit time. This are usually used to perform

View File

@ -26,6 +26,8 @@
* 2002.08.21 Dmitry Yemanov: fixed bug with a buffer overrun,
* which at least caused invalid dependencies
* to be stored (DB$xxx, for example)
* 2002.10.21 Nickolay Samofatov: Added support for explicit pessimistic locks
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
#include "firebird.h"
@ -98,7 +100,7 @@ static void list_staying(TDBB, RPB *, LLS *);
#ifdef GARBAGE_THREAD
static void notify_garbage_collector(TDBB, RPB *);
#endif
static void prepare_update(TDBB, TRA, SLONG, RPB *, RPB *, RPB *, LLS *);
static BOOLEAN prepare_update(TDBB, TRA, SLONG, RPB *, RPB *, RPB *, LLS *);
static BOOLEAN purge(TDBB, RPB *);
static REC replace_gc_record(REL, REC *, USHORT);
static void replace_record(TDBB, RPB *, LLS *, TRA);
@ -1004,7 +1006,7 @@ void VIO_data(TDBB tdbb, register RPB * rpb, BLK pool)
}
void VIO_erase(TDBB tdbb, RPB * rpb, TRA transaction)
BOOLEAN VIO_erase(TDBB tdbb, RPB * rpb, TRA transaction)
{
/**************************************
*
@ -1017,7 +1019,8 @@ void VIO_erase(TDBB tdbb, RPB * rpb, TRA transaction)
*
* This routine is entered with an inactive
* RPB and leaves having created an erased
* stub.
* stub. Returns FALSE if record was modified by
* another user
*
**************************************/
REL relation, r2;
@ -1064,7 +1067,7 @@ void VIO_erase(TDBB tdbb, RPB * rpb, TRA transaction)
reinterpret_cast<blk*>(
tdbb->tdbb_default))))
{
ERR_post(isc_deadlock, isc_arg_gds, isc_update_conflict, 0);
ERR_post(isc_deadlock, isc_arg_gds, isc_update_conflict, 0);
}
VIO_data(tdbb, rpb,
reinterpret_cast<blk*>(tdbb->tdbb_request->req_pool));
@ -1091,7 +1094,7 @@ void VIO_erase(TDBB tdbb, RPB * rpb, TRA transaction)
if (transaction->tra_flags & TRA_system)
{
VIO_backout(tdbb, rpb, transaction);
return;
return TRUE;
}
transaction->tra_flags |= TRA_write;
@ -1280,7 +1283,8 @@ void VIO_erase(TDBB tdbb, RPB * rpb, TRA transaction)
{
/* Update stub didn't find one page -- do a long, hard update */
stack = NULL;
prepare_update(tdbb, transaction, tid_fetch, rpb, &temp, 0, &stack);
if (!prepare_update(tdbb, transaction, tid_fetch, rpb, &temp, 0, &stack))
return FALSE;
/* Old record was restored and re-fetched for write. Now replace it. */
@ -1326,6 +1330,8 @@ void VIO_erase(TDBB tdbb, RPB * rpb, TRA transaction)
{
transaction->tra_flags |= TRA_perform_autocommit;
}
return TRUE;
}
@ -1845,7 +1851,7 @@ void VIO_init(TDBB tdbb)
#endif
void VIO_modify(TDBB tdbb, RPB * org_rpb, RPB * new_rpb, TRA transaction)
BOOLEAN VIO_modify(TDBB tdbb, RPB * org_rpb, RPB * new_rpb, TRA transaction)
{
/**************************************
*
@ -1894,9 +1900,10 @@ void VIO_modify(TDBB tdbb, RPB * org_rpb, RPB * new_rpb, TRA transaction)
(!VIO_chase_record_version
(tdbb, org_rpb, NULL, transaction,
reinterpret_cast <
blk * >(tdbb->tdbb_default)))) ERR_post(isc_deadlock,
isc_arg_gds,
isc_update_conflict, 0);
blk * >(tdbb->tdbb_default))))
{
ERR_post(isc_deadlock, isc_arg_gds, isc_update_conflict, 0);
}
VIO_data(tdbb, org_rpb,
reinterpret_cast < blk * >(tdbb->tdbb_request->req_pool));
@ -1907,7 +1914,9 @@ void VIO_modify(TDBB tdbb, RPB * org_rpb, RPB * new_rpb, TRA transaction)
if ((transaction->tra_flags & TRA_read_committed) &&
(tid_fetch != org_rpb->rpb_transaction))
ERR_post(isc_deadlock, isc_arg_gds, isc_update_conflict, 0);
{
ERR_post(isc_deadlock, isc_arg_gds, isc_update_conflict, 0);
}
org_rpb->rpb_stream_flags &= ~RPB_s_refetch;
}
@ -1920,7 +1929,7 @@ void VIO_modify(TDBB tdbb, RPB * org_rpb, RPB * new_rpb, TRA transaction)
if (transaction->tra_flags & TRA_system) {
update_in_place(tdbb, transaction, org_rpb, new_rpb);
return;
return TRUE;
}
/* If we're about to modify a system relation, check to make sure
@ -2016,12 +2025,13 @@ void VIO_modify(TDBB tdbb, RPB * org_rpb, RPB * new_rpb, TRA transaction)
(transaction->tra_save_point->sav_verb_count))
verb_post(tdbb, transaction, org_rpb, org_rpb->rpb_undo,
new_rpb, FALSE, FALSE);
return;
return TRUE;
}
stack = NULL;
prepare_update(tdbb, transaction, org_rpb->rpb_transaction, org_rpb,
&temp, new_rpb, &stack);
if (!prepare_update(tdbb, transaction, org_rpb->rpb_transaction, org_rpb,
&temp, new_rpb, &stack))
return FALSE;
/* Old record was restored and re-fetched for write. Now replace it. */
@ -2045,6 +2055,7 @@ void VIO_modify(TDBB tdbb, RPB * org_rpb, RPB * new_rpb, TRA transaction)
if (transaction->tra_flags & TRA_autocommit)
transaction->tra_flags |= TRA_perform_autocommit;
return TRUE;
}
@ -2177,7 +2188,7 @@ REC VIO_record(TDBB tdbb, register RPB * rpb, FMT format, JrdMemoryPool *pool)
}
void VIO_start_save_point(TDBB tdbb, TRA transaction)
void VIO_start_save_point(TDBB tdbb, TRA transaction, TEXT* name)
{
/**************************************
*
@ -2198,13 +2209,18 @@ void VIO_start_save_point(TDBB tdbb, TRA transaction)
SET_TDBB(tdbb);
if ( (sav_point = transaction->tra_save_free) )
if ( (sav_point = transaction->tra_save_free) ) {
transaction->tra_save_free = sav_point->sav_next;
else
sav_point->sav_flags = 0;
} else
sav_point = FB_NEW(*transaction->tra_pool) sav();
sav_point->sav_number = ++transaction->tra_save_point_number;
sav_point->sav_next = transaction->tra_save_point;
if (name) {
sav_point->sav_flags |= SAV_user;
strcpy(sav_point->sav_name, name);
}
transaction->tra_save_point = sav_point;
}
@ -2485,7 +2501,7 @@ void VIO_verb_cleanup(TDBB tdbb, TRA transaction)
#endif
if (transaction->tra_flags & TRA_system)
return;
sav_point = transaction->tra_save_point;
if (!sav_point)
return;
@ -3701,7 +3717,7 @@ static void notify_garbage_collector(TDBB tdbb, RPB * rpb)
#endif
static void prepare_update( TDBB tdbb,
static BOOLEAN prepare_update( TDBB tdbb,
TRA transaction,
SLONG commit_tid_read,
RPB* rpb,
@ -3899,7 +3915,7 @@ static void prepare_update( TDBB tdbb,
if (!DPM_fetch(tdbb, temp, LCK_write))
BUGCHECK(291); /* msg 291 cannot find record back version */
delete_(tdbb, temp, (SLONG) 0, 0);
ERR_post(isc_deadlock, isc_arg_gds, isc_update_conflict, 0);
return FALSE;
}
/*
@ -3953,7 +3969,7 @@ static void prepare_update( TDBB tdbb,
continue;
}
LLS_PUSH((BLK) temp->rpb_page, stack);
return;
return TRUE;
case tra_active:
case tra_limbo:
@ -4013,7 +4029,7 @@ static void prepare_update( TDBB tdbb,
}
switch (state) {
case tra_committed:
ERR_post(isc_deadlock, isc_arg_gds, isc_update_conflict, 0);
return FALSE;
case tra_active:
ERR_post(isc_deadlock, 0);
@ -4047,6 +4063,7 @@ static void prepare_update( TDBB tdbb,
VIO_backout(tdbb, rpb, transaction);
}
}
return TRUE;
}

View File

@ -19,6 +19,8 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* 2002.10.21 Nickolay Samofatov: Added support for explicit pessimistic locks
* 2002.10.29 Nickolay Samofatov: Added support for savepoints
*/
#ifndef _JRD_VIO_PROTO_H_
@ -35,7 +37,7 @@ extern int VIO_chase_record_version(TDBB, struct rpb *, class Rsb *,
extern int VIO_check_if_updated(TDBB, struct rpb *);
#endif
extern void VIO_data(TDBB, register struct rpb *, struct blk *);
extern void VIO_erase(TDBB, struct rpb *, struct tra *);
extern BOOLEAN VIO_erase(TDBB, struct rpb *, struct tra *);
#ifdef GARBAGE_THREAD
extern void VIO_fini(TDBB);
#endif
@ -49,12 +51,12 @@ extern int VIO_get_current(TDBB, struct rpb *, struct tra *, struct blk *,
extern void VIO_init(TDBB);
#endif
extern void VIO_merge_proc_sav_points(TDBB, struct tra *, struct sav **);
extern void VIO_modify(TDBB, struct rpb *, struct rpb *, struct tra *);
extern BOOLEAN VIO_modify(TDBB, struct rpb *, struct rpb *, struct tra *);
extern BOOLEAN VIO_next_record(TDBB, struct rpb *, class Rsb *, struct tra *,
struct blk *, BOOLEAN, BOOLEAN);
extern struct rec *VIO_record(TDBB, register struct rpb *, struct fmt *,
JrdMemoryPool *);
extern void VIO_start_save_point(TDBB, struct tra *);
extern void VIO_start_save_point(TDBB, struct tra *, TEXT *);
extern void VIO_store(TDBB, struct rpb *, struct tra *);
extern BOOLEAN VIO_sweep(TDBB, struct tra *);
extern void VIO_verb_cleanup(TDBB, struct tra *);

Binary file not shown.