2006/11/16, Wez Furlong <[EMAIL PROTECTED]>:
I think it would be better to pass in the pdo_dbh_t as the autharg to
the C level callback and then use that to determine if any of the
expensive work needs to be done in the callback.
Saves the sqlite_set_authorizer recall in SetAuthorizer, Looks si
I think it would be better to pass in the pdo_dbh_t as the autharg to
the C level callback and then use that to determine if any of the
expensive work needs to be done in the callback.
static int authorizer()
{
pdo_dbh_t *db;
/* keep the current safemode / basedir checks "cheap" and fast *
Short test script:
sqliteSetAuthorizer('auth');
$db->exec( "CREATE TABLE strings( a)");
$insert = $db->prepare( 'INSERT INTO strings VALUES ( ?)');
foreach ( $data as $str) {
$insert->execute( array( $str));
}
$insert = null;
echo "unregister authorizer\n";
$db->sqliteSetAuthorizer();
fun
2006/11/16, Mario Wolff <[EMAIL PROTECTED]>:
2006/11/16, Wez Furlong <[EMAIL PROTECTED]>:
> I suggest that you adjust your patch to cache the function callback
> information in the pdo_dbh_t to reduce some of that overhead, and run
> some benchmarks for a simple authorizer function in PHP that al
2006/11/16, Wez Furlong <[EMAIL PROTECTED]>:
I suggest that you adjust your patch to cache the function callback
information in the pdo_dbh_t to reduce some of that overhead, and run
some benchmarks for a simple authorizer function in PHP that always
returns true vs the same script with no author
@Wez: Whoop, just found you as maintainer in Pecl and send the same
request direct to you, sorry!
2006/11/16, Wez Furlong <[EMAIL PROTECTED]>:
Two comments about the patch:
- could you create a unified diff and post that instead?
Here it is!
- static local variable usage is not thread safe;
Two comments about the patch:
- could you create a unified diff and post that instead?
- static local variable usage is not thread safe; state should be
stored in the pdo_dbh_t structure.
And one concern:
I deliberately left this feature unimplemented so far because the
authorization callback w