diff options
author | Jan Lehnardt <jan@php.net> | 2002-02-12 18:29:27 +0000 |
---|---|---|
committer | Jan Lehnardt <jan@php.net> | 2002-02-12 18:29:27 +0000 |
commit | 9869854d476896c800d14e8244f91fec9b6b0586 (patch) | |
tree | 23d4cc90419f6c1ccfdc5d811c516647a2c755fa | |
parent | 3b01fd897317e9aca2444038ba476159c0f7b530 (diff) | |
download | php-git-9869854d476896c800d14e8244f91fec9b6b0586.tar.gz |
- added support for different error messages for the following cases:
-
- if a user with unsufficient permissions trys to select a database
- PEAR::DB previously threw a "no database selected" error instead
- of a more proper "insufficient permissions". This is fixed now.
-
- if a user selects a nonexistant database PEAR::DB threw a
- "no database selected" error instead of "no such database".
- This is fixed as well.
-
- I added two new constants to DB.php and a simple case construct to
- DB/mysql.php which can be easily extended to achive the above. I
- hope this is ok.
- Thanks to Till Gerken for mentioning this.
-rw-r--r-- | pear/DB.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pear/DB.php b/pear/DB.php index cd89cf75d0..86125a2b60 100644 --- a/pear/DB.php +++ b/pear/DB.php @@ -58,6 +58,8 @@ define("DB_ERROR_VALUE_COUNT_ON_ROW", -22); define("DB_ERROR_INVALID_DSN", -23); define("DB_ERROR_CONNECT_FAILED", -24); define("DB_ERROR_EXTENSION_NOT_FOUND",-25); +define("DB_ERROR_NOSUCHDB", -25); +define("DB_ERROR_ACCESS_VIOLATION", -26); /* * Warnings are not detected as errors by DB::isError(), and are not @@ -385,7 +387,9 @@ class DB DB_WARNING => 'unknown warning', DB_WARNING_READ_ONLY => 'read only', DB_ERROR_NEED_MORE_DATA => 'insufficient data supplied', - DB_ERROR_EXTENSION_NOT_FOUND=> 'extension not found' + DB_ERROR_EXTENSION_NOT_FOUND=> 'extension not found', + DB_ERROR_NOSUCHDB => 'no such database', + DB_ERROR_ACCESS_VIOLATION => 'insufficient permissions' ); } |