zendframework / zend-db

Db component from Zend Framework
BSD 3-Clause "New" or "Revised" License
101 stars 122 forks source link

ORA-01745: Ungültiger Host-/Bindevariablenname caused by :table #28

Open lkainers opened 9 years ago

lkainers commented 9 years ago

In /src/Metadata/Source/OracleMetadata.php#L127 :table is a reserved word and therefore the query fails

lkainers commented 9 years ago

The query does also contain additional line breaks (#125, #128) and a semicolon at the end (#129)

Ocramius commented 9 years ago

Linking sources: https://github.com/zendframework/zend-db/blob/790123893c01ad597b28652b2a382ac86186c6c8/src/Metadata/Source/OracleMetadata.php

Ocramius commented 9 years ago

@lkainers what oracle version are you testing against? Also, got an example of a generated query?

lkainers commented 9 years ago

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit

There is no generated query https://github.com/zendframework/zend-db/blob/790123893c01ad597b28652b2a382ac86186c6c8/src/Metadata/Source/OracleMetadata.php#L107 is the query

lkainers commented 9 years ago

$params = array( 'driver' => 'Oci8', 'hostname' => 'host', 'username' => 'user', 'password' => pass', 'port' => '', );

$connection = new Zend\Db\Adapter\Driver\Oci8\Connection($params); $driver = new Zend\Db\Adapter\Driver\Oci8\Oci8($connection); $adapter = new Zend\Db\Adapter\Adapter($driver);

$metadata = new Zend\Db\Metadata\Metadata($adapter); $metadata->getConstraints('tablename');

vixriihi commented 9 years ago

Here's a PR https://github.com/zendframework/zend-db/pull/34 that would fix this issue

michalbundyra commented 4 years ago

This repository has been closed and moved to laminas/laminas-db; a new issue has been opened at https://github.com/laminas/laminas-db/issues/142.