Index: trunk/phase3/includes/db/DatabaseMysql.php |
— | — | @@ -289,6 +289,13 @@ |
290 | 290 | return '[http://www.mysql.com/ MySQL]'; |
291 | 291 | } |
292 | 292 | |
| 293 | + /** |
| 294 | + * @return String: Database name for messages |
| 295 | + */ |
| 296 | + function getDBtype() { |
| 297 | + return 'MySQL'; |
| 298 | + } |
| 299 | + |
293 | 300 | public function setTimeout( $timeout ) { |
294 | 301 | $this->query( "SET net_read_timeout=$timeout" ); |
295 | 302 | $this->query( "SET net_write_timeout=$timeout" ); |
Index: trunk/phase3/includes/db/DatabaseOracle.php |
— | — | @@ -743,6 +743,13 @@ |
744 | 744 | } |
745 | 745 | |
746 | 746 | /** |
| 747 | + * @return String: Database name for messages |
| 748 | + */ |
| 749 | + function getDBtype() { |
| 750 | + return 'Oracle'; |
| 751 | + } |
| 752 | + |
| 753 | + /** |
747 | 754 | * Query whether a given table exists (in the given schema, or the default mw one if not given) |
748 | 755 | */ |
749 | 756 | function tableExists($table) { |
Index: trunk/phase3/includes/db/DatabasePostgres.php |
— | — | @@ -1048,6 +1048,13 @@ |
1049 | 1049 | } |
1050 | 1050 | |
1051 | 1051 | /** |
| 1052 | + * @return String: Database name for messages |
| 1053 | + */ |
| 1054 | + function getDBtype() { |
| 1055 | + return 'PostgreSQL'; |
| 1056 | + } |
| 1057 | + |
| 1058 | + /** |
1052 | 1059 | * @return string Version information from the database |
1053 | 1060 | */ |
1054 | 1061 | function getServerVersion() { |
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php |
— | — | @@ -1453,6 +1453,13 @@ |
1454 | 1454 | return "[http://www.ibm.com/software/data/db2/express/?s_cmp=ECDDWW01&s_tact=MediaWiki IBM DB2]"; |
1455 | 1455 | } |
1456 | 1456 | |
| 1457 | + /** |
| 1458 | + * @return String: Database name for messages |
| 1459 | + */ |
| 1460 | + function getDBtype() { |
| 1461 | + return 'IBM DB2'; |
| 1462 | + } |
| 1463 | + |
1457 | 1464 | ### |
1458 | 1465 | # Fix search crash |
1459 | 1466 | ### |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -1953,6 +1953,17 @@ |
1954 | 1954 | } |
1955 | 1955 | |
1956 | 1956 | /** |
| 1957 | + * Returns the database type for user-visible purposes |
| 1958 | + * e.g. DB error messages |
| 1959 | + * Other uses should just use $wgDBtype |
| 1960 | + * |
| 1961 | + * @return String: Database name for messages |
| 1962 | + */ |
| 1963 | + function getDBtype() { |
| 1964 | + return 'Database'; |
| 1965 | + } |
| 1966 | + |
| 1967 | + /** |
1957 | 1968 | * A string describing the current software version, like from |
1958 | 1969 | * mysql_get_server_info(). Will be listed on Special:Version, etc. |
1959 | 1970 | * |
— | — | @@ -2548,7 +2559,8 @@ |
2549 | 2560 | function getText() { |
2550 | 2561 | if ( $this->useMessageCache() ) { |
2551 | 2562 | return wfMsg( 'dberrortextcl', htmlspecialchars( $this->getSQL() ), |
2552 | | - htmlspecialchars( $this->fname ), $this->errno, htmlspecialchars( $this->error ) ) . "\n"; |
| 2563 | + htmlspecialchars( $this->fname ), $this->errno, htmlspecialchars( $this->error ), |
| 2564 | + htmlspecialchars( $this->db->getDBtype() ) ) . "\n"; |
2553 | 2565 | } else { |
2554 | 2566 | return $this->getMessage(); |
2555 | 2567 | } |
— | — | @@ -2575,7 +2587,8 @@ |
2576 | 2588 | function getHTML() { |
2577 | 2589 | if ( $this->useMessageCache() ) { |
2578 | 2590 | return wfMsgNoDB( 'dberrortext', htmlspecialchars( $this->getSQL() ), |
2579 | | - htmlspecialchars( $this->fname ), $this->errno, htmlspecialchars( $this->error ) ); |
| 2591 | + htmlspecialchars( $this->fname ), $this->errno, htmlspecialchars( $this->error ), |
| 2592 | + htmlspecialchars( $this->db->getDBtype() ) ); |
2580 | 2593 | } else { |
2581 | 2594 | return nl2br( htmlspecialchars( $this->getMessage() ) ); |
2582 | 2595 | } |
Index: trunk/phase3/includes/db/DatabaseMssql.php |
— | — | @@ -900,6 +900,13 @@ |
901 | 901 | } |
902 | 902 | |
903 | 903 | /** |
| 904 | + * @return String: Database name for messages |
| 905 | + */ |
| 906 | + function getDBtype() { |
| 907 | + return 'Microsoft SQL Server'; |
| 908 | + } |
| 909 | + |
| 910 | + /** |
904 | 911 | * @return string Version information from the database |
905 | 912 | */ |
906 | 913 | function getServerVersion() { |
Index: trunk/phase3/includes/db/DatabaseSqlite.php |
— | — | @@ -288,6 +288,13 @@ |
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
| 292 | + * @return String: Database name for messages |
| 293 | + */ |
| 294 | + function getDBtype() { |
| 295 | + return 'SQLite'; |
| 296 | + } |
| 297 | + |
| 298 | + /** |
292 | 299 | * @return string Version information from the database |
293 | 300 | */ |
294 | 301 | function getServerVersion() { |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -947,12 +947,12 @@ |
948 | 948 | The last attempted database query was: |
949 | 949 | <blockquote><tt>$1</tt></blockquote> |
950 | 950 | from within function "<tt>$2</tt>". |
951 | | -MySQL returned error "<tt>$3: $4</tt>".', |
| 951 | +$5 returned error "<tt>$3: $4</tt>".', |
952 | 952 | 'dberrortextcl' => 'A database query syntax error has occurred. |
953 | 953 | The last attempted database query was: |
954 | 954 | "$1" |
955 | 955 | from within function "$2". |
956 | | -MySQL returned error "$3: $4"', |
| 956 | +$5 returned error "$3: $4"', |
957 | 957 | 'laggedslavemode' => "'''Warning:''' Page may not contain recent updates.", |
958 | 958 | 'readonly' => 'Database locked', |
959 | 959 | 'enterlockreason' => 'Enter a reason for the lock, including an estimate of when the lock will be released', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -276,6 +276,8 @@ |
277 | 277 | * (bug 19513) RTL fixes for new Search UI |
278 | 278 | * (bug 16497) Special:Allmessages is paginated |
279 | 279 | * (bug 18708) CSS plainlinks class now available to all skins |
| 280 | +* (bug 19590) Database error messages no longer have "MySQL" hardcoded as the |
| 281 | + database type |
280 | 282 | |
281 | 283 | == API changes in 1.16 == |
282 | 284 | |