-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SqlBase::listTablesQuoted() does not work with PostgreSQL-15 with \timing in ~/.psqlrc #5545
Comments
Other solution would be to add the |
If the user turned on timing, then I'm not 100% sure we should turn it off for all our queries. I could go either way. |
Because it is part of the output, and it is not a valid table name.
|
The CI failed in MR #5546 because it uses PostgreSQL-10 and the |
Besides timing there are some pset commands that can mess the table processing. Seems like the |
There are other problems as well :-( \Drush\Sql\SqlPgsql::dbExists() Exit code of the command return $process->isSuccessful()
&& trim($process->getOutput()) === '1'; |
\Drush\Commands\core\ArchiveRestoreCommands::importDatabase if ($isDbExist && !$sql->drop($sql->listTablesQuoted())) {
throw new Exception(
dt('Failed to drop database !database.', ['!database' => $databaseSpec['database']])
);
}
if (!$isDbExist && !$sql->createdb(true)) {
throw new Exception(
dt('Failed to create database !database.', ['!database' => $databaseSpec['database']])
);
} ps.: Edited. #5639 |
Currently my problem is that I can't run the test when PostgreSQL port number is other than the default Environment variable |
Tests are create databases like this |
I think a --no-psqlrc flag would cause as much harm as good. |
@weitzman Could you provide some details? |
I just found this
That means Drush could ship a custom psqlrc file, and use it with every |
SqlBase::listTablesQuoted() adds invalid elements to the return array
Command sql:drop does not work with PostgreSQL(15.2) when the ~/.psqlrc contains
\timing
directive.After running the
drush sql:drop
command, every DB table is still there, and there is no error or warning in the stdOutput.Same problem with the
drush site:install
command.There is a confirmation question:
but after that the site install fails because of the still existing tables.
After a short debugging, I found that in the
\Drush\Commands\sql\SqlCommands::drop()
the
$tables = $sql->listTablesQuoted();
does not works as expected, because of the last item in the array is an invalid item.var_dump($tables);
The
Time: 1.169 ms
is there because my~/.psqlrc
contains the\timing
.System Configuration
The text was updated successfully, but these errors were encountered: