Added IBASE_REC_VERSION/IBASE_REC_NO_VERSION transaction constants

required from bugs #8797 #23887
(added IBASE_WRITE, IBASE_WAIT, IBASE_CONCURRENCY just for clarity)
This commit is contained in:
Daniela Mariaschi 2003-06-14 16:38:10 +00:00
parent 09eb38ec10
commit e8e4db8581
2 changed files with 34 additions and 17 deletions

View File

@ -546,13 +546,19 @@ PHP_MINIT_FUNCTION(ibase)
REGISTER_LONG_CONSTANT("IBASE_DEFAULT", PHP_IBASE_DEFAULT, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_TEXT", PHP_IBASE_TEXT, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_UNIXTIME", PHP_IBASE_UNIXTIME, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_READ", PHP_IBASE_READ, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_COMMITTED", PHP_IBASE_COMMITTED, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_CONSISTENCY", PHP_IBASE_CONSISTENCY, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_NOWAIT", PHP_IBASE_NOWAIT, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_TIMESTAMP", PHP_IBASE_TIMESTAMP, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_DATE", PHP_IBASE_DATE, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_TIME", PHP_IBASE_TIME, CONST_PERSISTENT);
/* transactions */
REGISTER_LONG_CONSTANT("IBASE_WRITE", PHP_IBASE_WRITE, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_READ", PHP_IBASE_READ, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_COMMITTED", PHP_IBASE_COMMITTED, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_CONSISTENCY", PHP_IBASE_CONSISTENCY, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_CONCURRENCY", PHP_IBASE_CONCURRENCY, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_REC_VERSION", PHP_IBASE_REC_VERSION, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_REC_NO_VERSION", PHP_IBASE_REC_NO_VERSION, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_NOWAIT", PHP_IBASE_NOWAIT, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_WAIT", PHP_IBASE_WAIT, CONST_PERSISTENT);
return SUCCESS;
}
@ -1547,22 +1553,27 @@ PHP_FUNCTION(ibase_trans)
if (trans_argl & PHP_IBASE_READ) { /* READ ONLY TRANSACTION */
tpb[tpb_len++] = isc_tpb_read;
} else {
tpb[tpb_len++] = isc_tpb_write;
tpb[tpb_len++] = isc_tpb_write; /* default access mode */
}
/* isolation level */
if (trans_argl & PHP_IBASE_COMMITTED) {
tpb[tpb_len++] = isc_tpb_read_committed;
if (trans_argl & PHP_IBASE_REC_VERSION) {
tpb[tpb_len++] = isc_tpb_rec_version;
}else{
tpb[tpb_len++] = isc_tpb_no_rec_version; /* default in read_committed */
}
} else if (trans_argl & PHP_IBASE_CONSISTENCY) {
tpb[tpb_len++] = isc_tpb_consistency;
} else {
tpb[tpb_len++] = isc_tpb_concurrency;
tpb[tpb_len++] = isc_tpb_concurrency; /* default isolation level */
}
/* lock resolution */
if (trans_argl & PHP_IBASE_NOWAIT) {
tpb[tpb_len++] = isc_tpb_nowait;
} else {
tpb[tpb_len++] = isc_tpb_wait;
tpb[tpb_len++] = isc_tpb_wait; /* default lock resolution */
}
}

View File

@ -159,16 +159,22 @@ typedef struct _php_ibase_varchar {
/* extern ibase_module php_ibase_module; */
enum php_interbase_option {
PHP_IBASE_DEFAULT = 0,
PHP_IBASE_TEXT = 1,
PHP_IBASE_UNIXTIME = 2,
PHP_IBASE_READ = 4,
PHP_IBASE_COMMITTED = 8,
PHP_IBASE_CONSISTENCY = 16,
PHP_IBASE_NOWAIT = 32,
PHP_IBASE_TIMESTAMP = 64,
PHP_IBASE_DATE = 128,
PHP_IBASE_TIME = 256
PHP_IBASE_DEFAULT = 0,
PHP_IBASE_TEXT = 1,
PHP_IBASE_UNIXTIME = 2,
PHP_IBASE_TIMESTAMP = 4,
PHP_IBASE_DATE = 8,
PHP_IBASE_TIME = 16,
/* transactions */
PHP_IBASE_WRITE = 2,
PHP_IBASE_READ = 4,
PHP_IBASE_COMMITTED = 8,
PHP_IBASE_CONSISTENCY = 16,
PHP_IBASE_CONCURRENCY = 32,
PHP_IBASE_REC_VERSION = 64,
PHP_IBASE_REC_NO_VERSION = 128,
PHP_IBASE_NOWAIT = 256,
PHP_IBASE_WAIT = 512
};
#ifdef ZTS