Fixes in DB\IO query detection regex

- start with allow whitespace in front
- returning allows more white space types between keyword and parameter list
This commit is contained in:
Clemens Schwaighofer
2023-02-02 10:27:07 +09:00
parent 5a81445a28
commit 53eef03387
2 changed files with 17 additions and 7 deletions

View File

@@ -153,9 +153,19 @@ var_dump($db->dbGetReturningExt());
// should throw deprecated error
// $db->getReturningExt();
$last_insert_pk = $db->dbGetInsertPK();
print "DIRECT INSERT PREVIOUS INSERTED: "
. print_r($db->dbReturnRow("SELECT test_foo_id, test FROM test_foo "
. "WHERE test_foo_id = " . $db->dbGetInsertPK()), true) . "<br>";
. "WHERE test_foo_id = " . $last_insert_pk), true) . "<br>";
$q = <<<EOM
SELECT
test_foo_id, test
FROM test_foo
WHERE test_foo_id = $last_insert_pk;
EOM;
print "EOM READ OF PREVIOUS INSERTED: " . print_r($db->dbReturnRow($q), true) . "<br>";
print "LAST ERROR: " . $db->dbGetLastError() . "<br>";
print "<br>";
// PREPARED INSERT
$db->dbPrepare("ins_test_foo", "INSERT INTO test_foo (test) VALUES ($1) RETURNING test");