Skip to content

Commit 8e8a23a

Browse files
committed
Revert "[RFC] Transition SQLite3 to exceptions (php#11058)"
This reverts commit ddd9a08.
1 parent 0b30104 commit 8e8a23a

13 files changed

+82
-122
lines changed

ext/sqlite3/sqlite3.c

Lines changed: 66 additions & 81 deletions
Large diffs are not rendered by default.

ext/sqlite3/sqlite3.stub.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@
6868
const SQLITE3_DETERMINISTIC = UNKNOWN;
6969
#endif
7070

71-
/**
72-
* @strict-properties
73-
*/
74-
class SQLite3Exception extends \Exception
75-
{
76-
}
77-
7871
/** @not-serializable */
7972
class SQLite3
8073
{

ext/sqlite3/sqlite3_arginfo.h

Lines changed: 1 addition & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/sqlite3/tests/bug69972.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ echo "Error Msg: " . $db->lastErrorMsg() . "\n";
1818
--EXPECTF--
1919
SELECTING from invalid table
2020

21-
Warning: SQLite3::query(): Unable to prepare statement: no such table: non_existent_table in %sbug69972.php on line %d
21+
Warning: SQLite3::query(): Unable to prepare statement: 1, no such table: non_existent_table in %sbug69972.php on line %d
2222
Closing database
2323
bool(true)
2424
Done

ext/sqlite3/tests/gh9032.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ try {
1717
$st->bindValue("a", ":memory:");
1818
$st->execute();
1919
var_dump($db->exec('create table db2.r (id int)'));
20-
} catch (SQLite3Exception $ex) {
20+
} catch (Exception $ex) {
2121
echo $ex->getMessage(), PHP_EOL;
2222
}
2323
?>
2424
--EXPECT--
2525
bool(true)
26-
Unable to prepare statement: not authorized
26+
Unable to prepare statement: 23, not authorized

ext/sqlite3/tests/sqlite3_20_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ echo "Done\n";
2020
--EXPECTF--
2121
SELECTING from invalid table
2222

23-
Warning: SQLite3::query(): Unable to prepare statement: no such table: non_existent_table in %s on line %d
23+
Warning: SQLite3::query(): Unable to prepare statement: 1, no such table: non_existent_table in %s on line %d
2424
Error Code: 1
2525
Error Msg: no such table: non_existent_table
2626
Closing database

ext/sqlite3/tests/sqlite3_33_load_extension_param.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ $db = new SQLite3(':memory:');
2020

2121
try {
2222
$db->loadExtension("");
23-
} catch (\Throwable $ex) {
23+
} catch (Extension $ex) {
2424
var_dump($ex->getMessage());
2525
}
2626

2727
?>
2828
--EXPECTF--
29-
string(61) "SQLite3::loadExtension(): Argument #1 ($name) cannot be empty"
29+
Warning: SQLite3::loadExtension(): Empty string as an extension in %s on line %d

ext/sqlite3/tests/sqlite3_34_load_extension_ext_dir.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ try {
2424

2525
?>
2626
--EXPECTF--
27-
Warning: SQLite3::loadExtension(): SQLite Extensions are disabled in %s on line %d
27+
Warning: SQLite3::loadExtension(): SQLite Extension are disabled in %s on line %d

ext/sqlite3/tests/sqlite3_40_setauthorizer.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ try {
7171
?>
7272
--EXPECT--
7373
int(1)
74-
Unable to prepare statement: not authorized
74+
Unable to prepare statement: 23, not authorized
7575
bool(true)
7676
int(42)
7777
string(6) "SELECT"
@@ -98,7 +98,7 @@ string(28) "sqlite_master,rootpage,main,"
9898
string(4) "READ"
9999
string(28) "sqlite_master,rootpage,main,"
100100
bool(true)
101-
Unable to prepare statement: not authorized
101+
Unable to prepare statement: 23, not authorized
102102
The authorizer callback returned an invalid type: expected int
103-
Unable to prepare statement: not authorized
104-
The authorizer callback returned an invalid value: 4200
103+
Unable to prepare statement: 23, not authorized
104+
The authorizer callback returned an invalid value

ext/sqlite3/tests/sqlite3_defensive.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ bool(true)
3737
int(1)
3838
int(1)
3939

40-
Warning: SQLite3::querySingle(): Unable to prepare statement: table sqlite_master may not be modified in %s on line %d
40+
Warning: SQLite3::querySingle(): Unable to prepare statement: 1, table sqlite_master may not be modified in %s on line %d
4141
bool(false)
42-
int(1)
42+
int(1)

ext/sqlite3/tests/sqlite3_enable_exceptions.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ echo "Done\n";
2424
--EXPECTF--
2525
bool(false)
2626
no such table: non_existent_table
27-
28-
Deprecated: SQLite3::enableExceptions(): Use of warnings for SQLite3 is deprecated in %s
2927
bool(true)
3028

3129
Warning: SQLite3::query(): no such table: non_existent_table in %s on line %d

ext/sqlite3/tests/sqlite3_prepare_faultystmt.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ $stmt = $db->prepare('SELECT foo FROM bar');
1616
var_dump($stmt);
1717
?>
1818
--EXPECTF--
19-
Warning: SQLite3::prepare(): Unable to prepare statement: no such table: bar in %s on line %d
19+
Warning: SQLite3::prepare(): Unable to prepare statement: 1, no such table: bar in %s on line %d
2020
bool(false)

ext/sqlite3/tests/sqlite3_trampoline_setauthorizer.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ try {
3838
Trampoline for authorizer
3939
int(1)
4040
Trampoline for authorizer
41-
Unable to prepare statement: not authorized
41+
Unable to prepare statement: 23, not authorized

0 commit comments

Comments
 (0)