-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Quoting behaves not as expected #226
Comments
Try disable quote identifiers in parameters of the PDO connection. use Laminas\Db\Adapter\Adapter;
$this->hostname = getenv('TESTS_LAMINAS_DB_ADAPTER_DRIVER_OCI8_HOSTNAME');
$this->database = getenv('TESTS_LAMINAS_DB_ADAPTER_DRIVER_OCI8_DATABASE');
$this->username = getenv('TESTS_LAMINAS_DB_ADAPTER_DRIVER_OCI8_USERNAME');
$this->password = getenv('TESTS_LAMINAS_DB_ADAPTER_DRIVER_OCI8_PASSWORD');
$this->dsn = sprintf('oci:dbname=//%s/%s',
$this->hostname,
$this->database
);
$driverOptions = [
'driver' => 'pdo_oci',
'dsn' => $this->dsn,
'username' => $this->username,
'password' => $this->password,
'platform_options' => [
'quote_identifiers' => false // <<< !!! HERE !!!
],
];
$adapter = new Adapter($driverOptions); |
@ZVanoZ I already tried this. The problem is then that other things are not quoted that should be. |
Identifier quoting issues are often related to #77 (original discussion at zendframework/zend-db#233) and maybe zendframework/zend-db#232. Maybe something in there could give a useful hint to fix in own fork fix. |
I have the same issue and also with brackets as table name (like Is there any solution for brackets? When this issue with whitespaces will be fixed? The solution was given 2 years ago. |
Bug Report
| Version(s) | 2.13.4
Current behavior
We have here an MSSQL database were we run these statements against:
the output is then this SQL statement:
SELECT [Company CH$Brand Product Line].[Code] AS [Code], [Company CH$Brand Product Line].[Description] AS [Description] FROM [Company CH$Brand Product Line] WHERE [\][Company] [CH$Brand] [Product] [Line].[Promotional] [Order] [Active][]] = :where1 ORDER BY [Description] ASC
As you can see there are wrong quotings after the WHERE. Once the backslash, then each word with a quote instead of all together and then at the end empty brackets.
Expected behavior
I would have expected to be like this:
SELECT [Company CH$Brand Product Line].[Code] AS [Code], [Company CH$Brand Product Line].[Description] AS [Description] FROM [Company CH$Brand Product Line] WHERE [Company CH$Brand Product Line].[Promotional Order Active] = :where1 ORDER BY [Description] ASC
The text was updated successfully, but these errors were encountered: