2001-05-23 15:26:42 +02:00
|
|
|
/*
|
|
|
|
* PROGRAM: JRD Access Method
|
|
|
|
* MODULE: constants.h
|
|
|
|
* DESCRIPTION: Misc system constants
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Interbase Public
|
|
|
|
* License Version 1.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy
|
|
|
|
* of the License at http://www.Inprise.com/IPL.html
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an
|
|
|
|
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
|
|
|
|
* or implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code was created by Inprise Corporation
|
|
|
|
* and its predecessors. Portions created by Inprise Corporation are
|
|
|
|
* Copyright (C) Inprise Corporation.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
* Contributor(s): ______________________________________.
|
2002-06-29 15:03:13 +02:00
|
|
|
*
|
2004-11-29 10:09:42 +01:00
|
|
|
* 2001.10.08 Claudio Valderrama: fb_sysflag enum with numbering
|
2002-06-29 15:03:13 +02:00
|
|
|
* for automatically created triggers that aren't system triggers.
|
2001-05-23 15:26:42 +02:00
|
|
|
*/
|
|
|
|
|
2003-10-03 03:34:14 +02:00
|
|
|
#ifndef JRD_CONSTANTS_H
|
|
|
|
#define JRD_CONSTANTS_H
|
2001-05-23 15:26:42 +02:00
|
|
|
|
|
|
|
/* BLOb Subtype definitions */
|
|
|
|
|
|
|
|
/* Subtypes < 0 are user defined
|
|
|
|
* Subtype 0 means "untyped"
|
|
|
|
* Subtypes > 0 are InterBase defined
|
|
|
|
*/
|
|
|
|
|
2004-04-29 19:48:39 +02:00
|
|
|
// BRS 29-Apr-2004
|
|
|
|
// replace those constants with public defined ones isc_blob_*
|
|
|
|
//
|
|
|
|
//const int BLOB_untyped = 0;
|
|
|
|
//
|
|
|
|
//const int BLOB_text = 1;
|
|
|
|
//const int BLOB_blr = 2;
|
|
|
|
//const int BLOB_acl = 3;
|
|
|
|
//const int BLOB_ranges = 4;
|
|
|
|
//const int BLOB_summary = 5;
|
|
|
|
//const int BLOB_format = 6;
|
|
|
|
//const int BLOB_tra = 7;
|
|
|
|
//const int BLOB_extfile = 8;
|
|
|
|
//const int BLOB_max_predefined_subtype = 9;
|
|
|
|
//
|
2001-05-23 15:26:42 +02:00
|
|
|
|
|
|
|
/* Column Limits */
|
|
|
|
|
2004-04-29 16:51:02 +02:00
|
|
|
const ULONG MAX_COLUMN_SIZE = 32767; /* Bytes */
|
2001-05-23 15:26:42 +02:00
|
|
|
|
|
|
|
/* Misc constant values */
|
|
|
|
|
2004-04-29 16:51:02 +02:00
|
|
|
const int USERNAME_LENGTH = 31; /* Bytes */
|
2004-11-11 06:37:52 +01:00
|
|
|
|
2004-02-13 12:15:49 +01:00
|
|
|
const size_t MAX_SQL_IDENTIFIER_SIZE = 32;
|
2005-05-18 13:06:15 +02:00
|
|
|
const size_t MAX_SQL_IDENTIFIER_LEN = MAX_SQL_IDENTIFIER_SIZE - 1;
|
2003-11-05 10:02:33 +01:00
|
|
|
typedef TEXT SqlIdentifier[MAX_SQL_IDENTIFIER_SIZE];
|
|
|
|
|
2004-11-27 07:54:18 +01:00
|
|
|
const char* const NULL_ROLE = "NONE";
|
2004-03-28 11:10:30 +02:00
|
|
|
|
|
|
|
const char* const PRIMARY_KEY = "PRIMARY KEY";
|
|
|
|
const char* const FOREIGN_KEY = "FOREIGN KEY";
|
|
|
|
const char* const UNIQUE_CNSTRT = "UNIQUE";
|
|
|
|
const char* const CHECK_CNSTRT = "CHECK";
|
|
|
|
const char* const NOT_NULL_CNSTRT = "NOT NULL";
|
|
|
|
|
2006-05-24 22:43:07 +02:00
|
|
|
const char* const REL_SCOPE_PERSISTENT = "persistent table \"%s\"";
|
|
|
|
const char* const REL_SCOPE_GTT_PRESERVE = "global temporary table \"%s\" of type on commit preserve rows";
|
|
|
|
const char* const REL_SCOPE_GTT_DELETE = "global temporary table \"%s\" of type on commit delete rows";
|
2004-03-28 11:10:30 +02:00
|
|
|
|
2001-05-23 15:26:42 +02:00
|
|
|
/* literal strings in rdb$ref_constraints to be used to identify
|
|
|
|
the cascade actions for referential constraints. Used
|
|
|
|
by isql/show and isql/extract for now. */
|
|
|
|
|
2003-11-05 10:02:33 +01:00
|
|
|
const char* const RI_ACTION_CASCADE = "CASCADE";
|
|
|
|
const char* const RI_ACTION_NULL = "SET NULL";
|
|
|
|
const char* const RI_ACTION_DEFAULT = "SET DEFAULT";
|
|
|
|
const char* const RI_ACTION_NONE = "NO ACTION";
|
|
|
|
const char* const RI_RESTRICT = "RESTRICT";
|
|
|
|
|
|
|
|
const char* const IMPLICIT_DOMAIN_PREFIX = "RDB$";
|
|
|
|
const int IMPLICIT_DOMAIN_PREFIX_LEN = 4;
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2004-03-28 11:10:30 +02:00
|
|
|
const char* const SQL_SECCLASS_PREFIX = "SQL$";
|
|
|
|
const int SQL_SECCLASS_PREFIX_LEN = 4;
|
|
|
|
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2002-06-29 15:03:13 +02:00
|
|
|
/******************************************/
|
|
|
|
/* System flag meaning - mainly Firebird. */
|
|
|
|
/******************************************/
|
|
|
|
|
2004-11-29 10:09:42 +01:00
|
|
|
enum fb_sysflag {
|
|
|
|
fb_sysflag_user = 0,
|
|
|
|
fb_sysflag_system = 1,
|
|
|
|
fb_sysflag_qli = 2,
|
|
|
|
fb_sysflag_check_constraint = 3,
|
|
|
|
fb_sysflag_referential_constraint = 4,
|
|
|
|
fb_sysflag_view_check = 5
|
2002-06-29 15:03:13 +02:00
|
|
|
};
|
|
|
|
|
2001-05-23 15:26:42 +02:00
|
|
|
|
|
|
|
/* UDF Arguments are numbered from 0 to MAX_UDF_ARGUMENTS --
|
2002-06-29 15:03:13 +02:00
|
|
|
argument 0 is reserved for the return-type of the UDF */
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2004-04-29 16:51:02 +02:00
|
|
|
const int MAX_UDF_ARGUMENTS = 10;
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2003-09-28 23:36:05 +02:00
|
|
|
// Maximum length of single line returned from pretty printer
|
2004-04-29 16:51:02 +02:00
|
|
|
const int PRETTY_BUFFER_SIZE = 1024;
|
2003-09-28 23:36:05 +02:00
|
|
|
|
2004-04-29 16:51:02 +02:00
|
|
|
const int MAX_INDEX_SEGMENTS = 16;
|
2003-10-17 22:29:52 +02:00
|
|
|
|
2003-11-03 18:14:45 +01:00
|
|
|
// Maximum index key length
|
2003-12-01 03:37:25 +01:00
|
|
|
// AB: If the maximum key-size will change, don't forget dyn.h and dba.epp
|
|
|
|
// which cannot use these defines.
|
2004-04-29 16:51:02 +02:00
|
|
|
const int MAX_KEY = 4096; // Maximum page size possible divide by 4 (16384 / 4)
|
|
|
|
const int MAX_KEY_PRE_ODS11 = 255; // Max key-size before ODS11
|
2003-11-03 18:14:45 +01:00
|
|
|
|
2005-05-28 00:45:31 +02:00
|
|
|
const USHORT SQL_MATCH_1_CHAR = '_'; /* Not translatable */
|
|
|
|
const USHORT SQL_MATCH_ANY_CHARS = '%'; /* Not translatable */
|
|
|
|
|
|
|
|
static const USHORT GDML_MATCH_ONE = '?';
|
|
|
|
static const USHORT GDML_MATCH_ANY = '*';
|
|
|
|
|
|
|
|
static const USHORT GDML_QUOTE = '@';
|
|
|
|
static const USHORT GDML_NOT = '~';
|
|
|
|
static const USHORT GDML_RANGE = '-';
|
|
|
|
static const USHORT GDML_CLASS_START= '[';
|
|
|
|
static const USHORT GDML_CLASS_END = ']';
|
|
|
|
static const USHORT GDML_SUBSTITUTE = '=';
|
|
|
|
static const USHORT GDML_FLAG_SET = '+';
|
|
|
|
static const USHORT GDML_FLAG_CLEAR = '-';
|
|
|
|
static const USHORT GDML_COMMA = ',';
|
|
|
|
static const USHORT GDML_LPAREN = '(';
|
|
|
|
static const USHORT GDML_RPAREN = ')';
|
2003-12-27 05:37:23 +01:00
|
|
|
|
2004-11-22 21:22:03 +01:00
|
|
|
const size_t MAX_CONTEXT_VARS = 1000; // Maximum number of context variables allowed for a single object
|
|
|
|
|
2005-10-21 11:43:26 +02:00
|
|
|
// Time precision limits and defaults for TIME/TIMESTAMP values.
|
|
|
|
// Currently they're applied to CURRENT_TIME[STAMP] expressions only.
|
|
|
|
|
|
|
|
// Should be more than 6 as per SQL spec, but we don't support more than 3 yet
|
|
|
|
const size_t MAX_TIME_PRECISION = 3;
|
|
|
|
// Consistent with the SQL spec
|
|
|
|
const size_t DEFAULT_TIME_PRECISION = 0;
|
|
|
|
// Should be 6 as per SQL spec
|
|
|
|
const size_t DEFAULT_TIMESTAMP_PRECISION = 3;
|
2003-10-17 22:29:52 +02:00
|
|
|
|
2005-10-21 11:43:26 +02:00
|
|
|
#endif // JRD_CONSTANTS_H
|