Bug #25282 [Com]: API missing two important parameters
| From: | lildurk25282 at gmail dot com | Date: | Wed, 01 Sep 2021 18:52:20 +0000 |
| Subject: | Bug #25282 [Com]: API missing two important parameters | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-236324@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=25282&edit=1
ID: 25282
Comment by: lildurk25282 at gmail dot com
Reported by: nigel at e-easy dot com dot au
Summary: API missing two important parameters
Status: Not a bug
Type: Bug
Package: InterBase related
Operating System: Irrelevant
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Lil Durk is a private agency dedicated to providing responsible access to legal cannabis for adults
aged 19 and older. Weâre an exclusively online retailer and wholesaler for recreational
cannabis and a trusted source for information about cannabis and cannabis-related issues. We believe
our work is meaningful and we take pride in our mandate to promote the socially responsible use of
legal cannabis. https://lildurk.com/
Previous Comments:
------------------------------------------------------------------------
[2003-08-28 18:06:43] abies@php.net
The constants are useless without a way of specifying a table name. Therefore, this will not be
changed. PHP5 will support table reservation by means of SET TRANSACTION statements.
------------------------------------------------------------------------
[2003-08-28 17:38:07] nigel at e-easy dot com dot au
Handling Lock Conflicts is what I'm trying to do.
By stating that I want to reserve a table as shared write, I can then update a single field much
faster, as any transaction can write to the table - even if it's been updated inside this
transaction space.
...Or so I thought...
On the Firebird list, they're stating that the default mode is Shared Write - not mentioned
anywhere in the PHP source.
Ah, another undocumented behaviour.
Thanks for your time!
N.
------------------------------------------------------------------------
[2003-08-28 04:47:26] abies@php.net
Passing the table reservation flags in this way will result in absolutely nothing, because they
require a table name as an extra argument. You cannot just lock all tables for [shared|protected]
[read|write].
As PHP5 will contain support in ibase_trans() for multiple databases, adding tablenames as arguments
as well would clutter up the prototype too much.
PHP5 _will_ allow you to execute SET TRANSACTION statements. Then you can pass table reservation
flags (with tablenames) anyway you like.
I seriously doubt, though, that unconditionally locking tables instead of only when necessary would
actually improve performance. As far as I know, these parameters were introduced to handle lock
conflicts.
------------------------------------------------------------------------
[2003-08-27 23:52:17] nigel at e-easy dot com dot au
The patch for interbase.c where we apply the mask for
PHP_IBASE_PROTECTED should read:
+ tpb[tpb_len++] = isc_tpb_protected
and NOT:
+ tpb[tpb_len++] = isc_tpb_shared
....sorry...
------------------------------------------------------------------------
[2003-08-27 23:48:23] nigel at e-easy dot com dot au
Description:
------------
PHP's support for Interbase(Firebird) is missing two important
features for transaction handling - Shared, and Protected.
These two additions enable performance to surpass Oracle on
updates under heavy load.
The patch is as follows:
--- interbase.c.orig Thu Aug 28 11:39:22 2003
+++ interbase.c Thu Aug 28 12:22:44 2003
@@ -563,6 +563,8 @@
REGISTER_LONG_CONSTANT("IBASE_REC_NO_VERSION",
PHP_IBASE_REC_NO_VERSION
, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_NOWAIT",
PHP_IBASE_NOWAIT, CONST_PERSISTE
NT);
REGISTER_LONG_CONSTANT("IBASE_WAIT",
PHP_IBASE_WAIT, CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IBASE_SHARED",
PHP_IBASE_SHARED, CONST_PERSISTE
NT);
+ REGISTER_LONG_CONSTANT("IBASE_PROTECTED",
PHP_IBASE_PROTECTED, CONST_PE
RSISTENT);
return SUCCESS;
}
@@ -1574,6 +1576,13 @@
tpb[tpb_len++] = isc_tpb_nowait;
} else {
tpb[tpb_len++] = isc_tpb_wait; /* default lock
resolut
ion */
+ }
+ /* Pre Allocation Modes */
+ if (trans_argl & PHP_IBASE_SHARED) {
+ tpb[tpb_len++] = isc_tpb_shared;
+ }
+ if (trans_argl & PHP_IBASE_PROTECTED) {
+ tpb[tpb_len++] = isc_tpb_shared;
}
}
--- php_interbase.h.orig Thu Aug 28 11:59:34 2003
+++ php_interbase.h Thu Aug 28 12:21:34 2003
@@ -175,7 +175,9 @@
PHP_IBASE_REC_VERSION = 64,
PHP_IBASE_REC_NO_VERSION = 128,
PHP_IBASE_NOWAIT = 256,
- PHP_IBASE_WAIT = 512
+ PHP_IBASE_WAIT = 512,
+ PHP_IBASE_SHARED = 1024,
+ PHP_IBASE_PROTECTED = 2048
};
#ifdef ZTS
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=25282&edit=1