diff --git a/src/dsql/dsql.cpp b/src/dsql/dsql.cpp index 0fc9c34fa7..f99c6ac93a 100644 --- a/src/dsql/dsql.cpp +++ b/src/dsql/dsql.cpp @@ -1332,8 +1332,6 @@ static dsql_req* prepareStatement(thread_db* tdbb, dsql_dbb* database, jrd_tra* if (text && textLength == 0) textLength = static_cast(strlen(text)); - // just a safety check - const ULONG MAX_SQL_LENGTH = 10 * 1024 * 1024; // 10 MB textLength = MIN(textLength, MAX_SQL_LENGTH); TraceDSQLPrepare trace(database->dbb_attachment, transaction, textLength, text); diff --git a/src/isql/isql.epp b/src/isql/isql.epp index 9e854880e0..0abf07eafd 100644 --- a/src/isql/isql.epp +++ b/src/isql/isql.epp @@ -2077,7 +2077,7 @@ static processing_state add_row(TEXT* tabname) } const size_t length = strlen(lastInputLine); - if (length > MAX_USHORT - 2) + if (length > MAX_SQL_LENGTH) { IUTILS_msg_get(BUFFER_OVERFLOW, msg); STDERROUT(msg); @@ -3385,7 +3385,7 @@ static bool bulk_insert_retriever(const char* prompt) if (length == 0) rc = true; */ - if (length > MAX_USHORT - 2) + if (length > MAX_SQL_LENGTH) { TEXT msg[MSG_LENGTH]; IUTILS_msg_get(BUFFER_OVERFLOW, msg); @@ -4158,7 +4158,7 @@ static void do_isql() // code tells us we are done Firebird::Array stmt; - const size_t stmtLength = MAX_USHORT; + const size_t stmtLength = MAX_SQL_LENGTH; TEXT* statement = stmt.getBuffer(stmtLength); processing_state ret; diff --git a/src/jrd/constants.h b/src/jrd/constants.h index f1d9b499ac..0c9e83dba7 100644 --- a/src/jrd/constants.h +++ b/src/jrd/constants.h @@ -68,6 +68,8 @@ const size_t MAX_SQL_IDENTIFIER_LEN = METADATA_IDENTIFIER_CHAR_LEN * METADATA_BY const size_t MAX_SQL_IDENTIFIER_SIZE = MAX_SQL_IDENTIFIER_LEN + 1; typedef TEXT SqlIdentifier[MAX_SQL_IDENTIFIER_SIZE]; +const ULONG MAX_SQL_LENGTH = 10 * 1024 * 1024; // 10 MB - just a safety check + const char* const DB_KEY_NAME = "DB_KEY"; const char* const RDB_DB_KEY_NAME = "RDB$DB_KEY"; const char* const RDB_RECORD_VERSION_NAME = "RDB$RECORD_VERSION";