X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2Fsqlite.inc;h=9729a726bbfa240a4df5abd736b7d8bc2878f280;hb=280cb03b4d87e864a723686daf5d1699b3566ec1;hp=08188cade4433a0698cc5122f1853e6e4fcb488e;hpb=b50e1cf5a7eeb8d55e8d0c02cf3bbc772338e2f9;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/sqlite.inc b/maintenance/sqlite.inc index 08188cade4..9729a726bb 100644 --- a/maintenance/sqlite.inc +++ b/maintenance/sqlite.inc @@ -40,9 +40,9 @@ class Sqlite { * Checks given files for correctness of SQL syntax. MySQL DDL will be converted to * SQLite-compatible during processing. * Will throw exceptions on SQL errors - * @param $files + * @param array|string $files * @throws MWException - * @return mixed true if no error or error string in case of errors + * @return string|bool true if no error or error string in case of errors */ public static function checkSqlSyntax( $files ) { if ( !Sqlite::isPresent() ) { @@ -78,6 +78,7 @@ class Sqlite { foreach ( $columns as $col ) { if ( !isset( $allowedTypes[strtolower( $col->type )] ) ) { $db->close(); + return "Table {$table->name} has column {$col->name} with non-native type '{$col->type}'"; } } @@ -86,6 +87,7 @@ class Sqlite { return $e->getMessage(); } $db->close(); + return true; } -}; +}