[DBAL-402] Fatal error: Uncaught exception Created: 29/Dec/12 Updated: 08/Apr/13 |
|
| Status: | Open |
| Project: | Doctrine DBAL |
| Component/s: | Drivers |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Ruslan | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | dql, oracle | ||
| Description |
Fatal error: Uncaught exception 'Doctrine\DBAL\Driver\OCI8\OCI8Exception' with message 'ORA-00904: "T0"."ID": invalid identifier' in /var/www/doctrine/doctrine/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php on line 28 Doctrine\DBAL\Driver\OCI8\OCI8Exception: ORA-00904: "T0"."ID": invalid identifier in /var/www/doctrine/doctrine/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php on line 28 Call Stack: 0.0002 665368 1. {main}() /var/www/doctrine/doctrine/tools/sandbox/index.php:0 0.3389 6023864 2. Doctrine\ORM\EntityManager->find() /var/www/doctrine/doctrine/tools/sandbox/index.php:71 0.3514 8264024 3. Doctrine\ORM\Persisters\BasicEntityPersister->load() /var/www/doctrine/doctrine/lib/Doctrine/ORM/EntityManager.php:444 0.3521 8413576 4. Doctrine\DBAL\Connection->executeQuery() /var/www/doctrine/doctrine/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php:725 0.3532 8625920 5. Doctrine\DBAL\Driver\OCI8\OCI8Statement->execute() /var/www/doctrine/doctrine/lib/vendor/doctrine-dbal/lib/Doctrine/DBAL/Connection.php:635 Variables in local scope (#5): $hasZeroIndex = *uninitialized* $key = *uninitialized* $params = NULL $ret = FALSE $val = *uninitialized* |
| Comments |
| Comment by Benjamin Eberlei [ 06/Jan/13 ] |
|
Format code sample |
| Comment by Benjamin Eberlei [ 04/Apr/13 ] |
|
What is wrong here? The error alone is not very helpful |
[DBAL-131] Remove Static Types Created: 19/Jun/11 Updated: 20/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine DBAL |
| Component/s: | Drivers |
| Affects Version/s: | None |
| Fix Version/s: | 2.4 |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
the static types should be removed and made to instances of types that can differ between platforms. Following reasons: 1. Some vendors already convert values to PHP types, for example integers. Not converting again could save about 15% wall-time for integers for example. |
[DBAL-125] Add Informix Support Created: 08/Jun/11 Updated: 11/Jun/11 |
|
| Status: | Open |
| Project: | Doctrine DBAL |
| Component/s: | Drivers |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major |
| Reporter: | Adolfo Flores | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux, Unix & Windows |
||
| Description |
|
Today exist many customers with Informix 11.50 and they will deveoplment with php+simphony, but doctrine will be an alternative inside the framework but it isn't supported. Adolfo Flores |
| Comments |
| Comment by Benjamin Eberlei [ 08/Jun/11 ] |
|
There is a possibility to support Informix, this is described here: http://www.doctrine-project.org/docs/dbal/2.0/en/reference/supporting-other-databases.html I don't know informix and never worked with it, if you would volunteer to code this i would be enternelly grateful I think a working prototype can be implemented in 4-6h of time. |
| Comment by Adolfo Flores [ 08/Jun/11 ] |
|
good idea, I am an expert in informix database and I may need support in doctrine. Is there any template to follow? I have read the required structure in the url given, it seems feasible. What next step? I am installing Informix, php 5.3 on RHES 5.2 All 32-bit Regards, Adolfo Note: .I have no time basis, so that one week would be a reasonable time for this activity |
| Comment by Benjamin Eberlei [ 11/Jun/11 ] |
|
I added some more details to the chapter, here is the part: Implementation Steps in Detail 1. Add your driver shortcut to class-name `Doctrine\DBAL\DriverManager`. Essentially Driver, Statement are the PDO equivalents of "PDO" and "PDOStatement", they even have the exact same API. OCI8 is a good example to see how it works. If Informix works with PDO then its even simpler, take a look at Doctrine\DBAL\Driver\PDO namespace, you don't need to implement the connection and statement then, just the driver taking care of the configuraiton. The most complicated thing is to get the Platform and SchemaManager to work. Both are responsible for SQL generation for DDL statements for example. It makes sense to run the phpunit testsuite and fix the bugs when occuring until all tests pass. Also looking at the platform and schema managers of other databases is a very good help |
[DBAL-124] OCI8 Adapter (convertPositionalToNamedPlaceholders) Statemachine doesn't consider comments and strings Created: 20/May/11 Updated: 28/Jun/11 |
|
| Status: | Open |
| Project: | Doctrine DBAL |
| Component/s: | Drivers |
| Affects Version/s: | 2.0.5 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major |
| Reporter: | Carsten Hetzel | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
SQL statements may contain question marks in strings, inline comments or comment blocks. The current implementation of the method "convertPositionalToNamedPlaceholders()" doesn't consider these implications and falsely replaces them by named bind variables. Replacement code with example: <?php $s = '-- Testkomm?ntar select /* ? *//* ??? */ ?||\'H"al?l"o?\' as "h?""llo" union /* "? Kommentar" \' */ /* ?" */ select \'/*Hallo\'||to_char( ? ) union select \'--Welt\' union-- select ?'; echo 'In: ' . $s . PHP_EOL; $bind = 0; $skip = array( '--' => PHP_EOL, '/*' => '*/', '"' => '"', "'" => "'" ); for( $i = 0; $i < strlen( $s ) /* size of string might change! */; /* yes, no increment here! */ ) { // Skipping comments and literals foreach( $skip as $begin => $end ) { $matches = substr_compare( $s, $begin, $i, strlen( $begin ) ); if( $matches !== false && $matches == 0 ) { $pos = strpos( $s, $end, $i+strlen( $begin ) ); // echo "Found $begin, skipping at $i to $end at $pos" . PHP_EOL; if( $pos === false ) { // No more data or illegal statement - anyway: no more replacements! // echo "EOD" . PHP_EOL; break 2; } $i = $pos + strlen( $end ); continue 2; // Ensure we match /*..*//*..*/, '''' or """" - that's why we don't ++$i in the for-loop! } } if( $s[$i] == "?" ) { // Positional to named // echo "Replace $bind" . PHP_EOL; $r = ':name' . ++$bind; $s = substr_replace( $s, $r, $i, 1 ); $i += strlen( $r ); } ++$i; } echo 'Out: ' . $s . PHP_EOL; |
| Comments |
| Comment by Benjamin Eberlei [ 19/Jun/11 ] |
|
This algorithmus is painfully slow. There has to be something better, why do you need to foreach the loop inside the for? |
| Comment by Carsten Hetzel [ 28/Jun/11 ] |
|
Ok, sent you a PM but I'll put my response here, too: "Painfully slow" at what circumstances? Benchmarks? This was meant as an example implementation to show the problems of the current implementation - there's always room for improvement. And never forget: Premature optimization is the root of all evil! ;-p You want speed - try this one: <?php
$sql = '-- Testkomm?ntar
select /* ? *//* ??? */ ?||\'H"al?l"o?\' as "h?""llo" union /* "? Kommentar" \' */
/* ?" */ select \'/*Hallo\'||to_char( ? ) union select \'--Welt\'
union--
select ?';
echo 'In: ' . $sql . PHP_EOL;
$map = array();
for( $cnt = 0; $cnt < 1000; ++$cnt )
{
$bind = 0;
$s = $sql;
if( isset( $map[$s] ) )
continue;
$strlen = strlen( $s );
for( $i = 0; $i < $strlen /* size of string might change! */; /* yes, no increment here! */ )
{
$c1 = $s[$i];
$c2 = isset( $s[$i+1] ) ? $s[$i+1] : '';
if( $c1 == '-' && $c2 == '-')
{
$pos = strpos( $s, PHP_EOL, $i+2 );
if( $pos === false )
{
break 2;
}
$i = $pos + 2;
}
elseif( $c1 == '/' && $c2 == '*' )
{
$pos = strpos( $s, '*/', $i+2 );
if( $pos === false )
{
break 2;
}
$i = $pos + 2;
}
elseif( $c1 == '"' )
{
$pos = strpos( $s, '"', $i+1 );
if( $pos === false )
{
break 2;
}
$i = $pos + 1;
}
elseif( $c1 == "'" )
{
$pos = strpos( $s, "'", $i+1 );
if( $pos === false )
{
break 2;
}
$i = $pos + 1;
}
elseif( $c1 == "?" )
{
// Positional to named
// echo "Replace $bind" . PHP_EOL;
$r = ':name' . ++$bind;
$s = substr_replace( $s, $r, $i, 1 );
$rLen = strlen( $r );
$i += $rLen;
$strlen += $rLen - 1;
}
else
++$i;
}
$map[$sql] = $s;
}
echo 'Out: ' . $map[$sql] . PHP_EOL;
ATTENTION: Each "break 2;" means, you have an invalid statement! Do, whatever the statement class is supposed to do in this case! Regards, Carsten |
[DBAL-162] BeforeInsertID & AfterInsertID emulation workflow, wie bei MDB2 Created: 10/Sep/11 Updated: 20/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine DBAL |
| Component/s: | Drivers |
| Affects Version/s: | 2.1 |
| Fix Version/s: | 2.4 |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The following workflow is necessary for portable code to work on all platforms: $nextId = $conn->nextSequenceId();
$query = "INSERT INTO (id) VALUES (?)";
$conn->executeUpdate($query, array($nextId));
$nextId = $conn->lastInsertId();
|
[DBAL-367] Reverse engnering do not work with Oracle DB Created: 18/Oct/12 Updated: 23/Jan/13 |
|
| Status: | Open |
| Project: | Doctrine DBAL |
| Component/s: | Drivers, Schema Managers |
| Affects Version/s: | 2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Zelenin Alexandr | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | Cli, oracle, schematool | ||
| Environment: |
PHP 5.3.3-1ubuntu9.10 with Suhosin-Patch (cli) (built: Feb 11 2012 06:21:15) |
||
| Description |
$ doctrine orm:convert-mapping --filter="ms$ions" xml .
[Doctrine\DBAL\DBALException]
Unknown database type binary_float requested, Doctrine\DBAL\Platforms\OraclePlatform may not support it.
cli-config.php: use Doctrine\Common\Annotations\AnnotationReader; use Doctrine\Common\Annotations\AnnotationRegistry; require_once 'Doctrine/Common/ClassLoader.php'; define('APPLICATION_ENV', "development"); error_reporting(E_ALL); $classLoader = new \Doctrine\Common\ClassLoader('Doctrine'); $classLoader->register(); $config = new \Doctrine\ORM\Configuration(); $config->setProxyDir(__DIR__); $config->setProxyNamespace('Proxies'); $config->setAutoGenerateProxyClasses((APPLICATION_ENV == "development")); AnnotationRegistry::registerFile("Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php"); $reader = new AnnotationReader(); $driverImpl = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, array(__DIR__ . "/../php/ru/niifhm/bioinformatics/biodb/model")); $config->setMetadataDriverImpl($driverImpl); if (APPLICATION_ENV == "development") { $cache = new \Doctrine\Common\Cache\ArrayCache(); } else { $cache = new \Doctrine\Common\Cache\ApcCache(); } $config->setMetadataCacheImpl($cache); $config->setQueryCacheImpl($cache); $connectionOptions = array( 'driver' => 'oci8', 'host' => 'host.name', 'dbname' => 'db.name', 'user' => 'user.name', 'password' => 'user.password' ); $em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config); $platform = $em->getConnection()->getDatabasePlatform(); $platform->registerDoctrineTypeMapping('enum', 'string'); $em->getConfiguration()->setMetadataDriverImpl( new \Doctrine\ORM\Mapping\Driver\DatabaseDriver( $em->getConnection()->getSchemaManager() ) ); $helperSet = new \Symfony\Component\Console\Helper\HelperSet(array( 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em) )); |
| Comments |
| Comment by Marco Pivetta [ 23/Jan/13 ] |
|
Formatting |
[DBAL-330] [GH-191] Akiban Driver Implementation that Uses PDO Created: 27/Aug/12 Updated: 11/Dec/12 |
|
| Status: | Open |
| Project: | Doctrine DBAL |
| Component/s: | Drivers |
| Affects Version/s: | 2.4 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | akiban | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of posulliv: Url: https://github.com/doctrine/dbal/pull/191 Message: Based on discussion in pull request 188 with @stof, I decided to modify the implementation for Akiban to use the PostgreSQL PDO driver instead of the native PHP client for PostgreSQL. One piece of functionality that does not work with current version of Akiban is lastInsertId. This is because the implementation of CURRVAL for Akiban requires both schema name and sequence name be provided whereas PostgreSQL only requires sequence name ([relevant source](https://github.com/php/php-src/blob/master/ext/pdo_pgsql/pgsql_driver.c#L360)). I will attempt to get CURRVAL in Akiban implemented to have the same parameters as PostgreSQL. This causes a few tests to fail in the test suite right now. Is there a way to mark a test as expected to fail for a specific database driver with the test suite? What I did in this pull request is skip any tests that use lastInsertId when testing against the Akiban platform. I'll update these tests to not be skipped when CURRVAL works as expected. Let me know if there is a better way to do that. |
[DBAL-505] Issue whenusing serial columns in PostgreSQL Created: 24/Apr/13 Updated: 24/Apr/13 |
|
| Status: | Open |
| Project: | Doctrine DBAL |
| Component/s: | Drivers, Platforms, Schema Managers |
| Affects Version/s: | 2.3.3 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | jos de witte | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
PostgreSQL |
||
| Description |
|
When using Doctrine ORM mapping fields like this: /**
It first creates the migration perfectly as a serial column with the correct schema. However when making a new migration diff it generates DROP statements for every sequence for these id, so we have to remove them manually every time. |
[DBAL-407] Refactor exceptions Created: 07/Jan/13 Updated: 06/May/13 |
|
| Status: | Open |
| Project: | Doctrine DBAL |
| Component/s: | Drivers, Platforms, Schema Managers |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Bart van den Burg | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
It's currently rather hard to figure out what went wrong when for example a DBALException was thrown. You have to actually match the message in it, or read the status code of the ->getPrevious() exception, which can be different for all drivers (as https://github.com/jackalope/jackalope-doctrine-dbal/issues/80 shows). I'd suggest creating new exception classes for all situations and throwing them instead. If they extend the DBAL Exception and pass the message to it as it is right now, there will be no BC break. If this were to be done, on which branch should this be applied? |
| Comments |
| Comment by Christophe Coevoet [ 07/Jan/13 ] |
|
This should be done in the master branch. Another solution, avoiding to create many classes, would be to use the exception code, which is always kept as 0 currently (the default value of the Exception class). You could have a code for each case (with constants in the DBALException class) and then checking $e->getCode() to identify what went wrong. |
| Comment by Bart van den Burg [ 07/Jan/13 ] |
|
I'd prefer actual named exceptions. It makes catching them simpler. However, adding some code defined in DBAL would be an acceptable alternative. try { /* ... /* } catch (NoSuchTableException $e) { // do something } catch (DuplicateKeyException $e) { // do something else } v.s. try { /* ... /* } catch (DBALException $e) { if ($e->getCode() == DBALException::NO_SUCH_TABLE) { // do something } elseif ($e->getCode() == DBALException::DUPLICATE_KEY) { // do something else } else { throw $e; } } |
| Comment by Christopher Davis [ 06/May/13 ] |
|
I would also prefer named exceptions. You're going to have a lot of problems providing the "code" value in DBALException in any case: SQLSTATE codes are alphanumeric, and will cause warnings/errors when creating new exception. Besides we can get the SQL state code now: try {
// ...
} catch (\Doctrine\DBAL\DBALException $e) {
$code = $e->getPrevious()->getCode();
// do stuff with $code
}
The problem is that there are a lot of error codes defined in the ANSI SQL standard: http://www.postgresql.org/docs/9.2/static/errcodes-appendix.html Maybe throwing an specific exception for each "class" of SQLSTATE codes? So if the error code from a PDO exception starts with 23, DBAL would throw `\Doctrine\DBAL\Exception\IntegrityConstraintViolationException`. This also seems like the logic to handle throwing exceptions should be contained in the platforms as some implementations may differ. You could have a method in `AbstractPlatform` that takes care of the ANSI SQLSTATE error code classes and leave it up subclasses to deal with platform specific cases. Whenever `Connection` catches a `PDOException`, dispatch it to the platform to deal with. Example: https://gist.github.com/chrisguitarguy/e021918900e93dca304d Thoughts? |
| Comment by Matthieu Napoli [ 06/May/13 ] |
|
I have implemented a thing of that kind in a personal project (on top of Doctrine). It is really useful to be able to catch a ForeignKeyViolationException, and get with entity/field caused the problem (for that my EntityManager wrapper parse the exception message). However, note that exception codes differ from DB engines. In my case, I did it quick and used MySQL error codes, but managing different RDBMS implies more work. |
[DBAL-504] DBAL Enum fields migration issue / PostgreSQL Created: 24/Apr/13 Updated: 06/May/13 |
|
| Status: | Awaiting Feedback |
| Project: | Doctrine DBAL |
| Component/s: | Drivers, Schema Managers |
| Affects Version/s: | 2.3.3 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | jos de witte | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
postgresql |
||
| Issue Links: |
|
||||||||
| Description |
|
When using Custom Doctrine DBAL Enums the migration created using diff works fine the first time. However the next time it generates a SQL statement trying to change to field type to INT from integer; (Redundant) "ALTER schemaname.fieldname SET" .. And that's it. |
| Comments |
| Comment by Tom Vogt [ 01/May/13 ] |
|
Doesn't only happen on Enums. I don't use any enums and I have this problem. I use a couple of geo (postGIS) fields (point, linestring, polygon) as well as array fields, so either or all of those might be causing it, too. |
| Comment by Benjamin Eberlei [ 04/May/13 ] |
|
We did some changes for PostgreSQL column diffs lately, can you verify this bug still exists on the 2.3 Branch of DBAL? |
| Comment by Tom Vogt [ 06/May/13 ] |
|
I'm running this on Symfony2 with this composer.json config: "doctrine/orm": "2.3.*", and I'm still getting this issue today. |
[DBAL-167] Schema comparator doesn't work properly with columnDefinition's Created: 17/Sep/11 Updated: 16/Jul/12 |
|
| Status: | Open |
| Project: | Doctrine DBAL |
| Component/s: | Drivers, Platforms, Schema Managers |
| Affects Version/s: | 2.0.8, 2.1, 2.1.1, 2.1.2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Minor |
| Reporter: | Dmitry Strygin | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | None | ||
| Description |
|
Schema comparator will mostly always return changed properties on columns for entities defined with columnDefinition even they are identical in the DB. This is due to weak low-lever compatibility of SchemaTool#getCreateSchemaSql() and SchemaTool#getSchemaFromMetadata() – the first one doesn't reconstruct columnDefinition, and the other one never supports 'fixed', 'default', cannot determine, whether it is boolean or integer (ex. TINYINT in the DB), etc... All this results in extremely annoying unnecessary alter-table-change-columns surrounded by dropping and after that re-enabling constrains dependent on those columns. I mean stuff like this: symfony2#app/console doctrine:schema:update --dump-sql ... ALTER TABLE es_hotels DROP FOREIGN KEY FK_527F88EE584598A3F92F3E70; ALTER TABLE es_hotels DROP FOREIGN KEY FK_527F88EE584598A37A3ABE5D; ALTER TABLE es_hotels DROP FOREIGN KEY FK_527F88EE584598A3EE551564; ALTER TABLE es_hotels CHANGE is_active is_active TINYINT(1) NOT NULL DEFAULT '1', CHANGE checksum checksum CHAR(32) DEFAULT NULL; ALTER TABLE es_hotels ADD CONSTRAINT FK_527F88EE584598A3F92F3E70 FOREIGN KEY (operator_id, country_id) REFERENCES es_countries(operator_id, id) ON DELETE CASCADE; ALTER TABLE es_hotels ADD CONSTRAINT FK_527F88EE584598A37A3ABE5D FOREIGN KEY (operator_id, resort_id) REFERENCES es_resorts(operator_id, id) ON DELETE CASCADE; ALTER TABLE es_hotels ADD CONSTRAINT FK_527F88EE584598A3EE551564 FOREIGN KEY (operator_id, subresort_id) REFERENCES es_subresorts(operator_id, id) ON DELETE CASCADE; ... The simple solution would be to fix schema comparator not to signal any changes on columns with columnDefinition properties. I can do this |
| Comments |
| Comment by Roderick Schaefer | We handle IT [ 16/Oct/11 ] |
|
I'm having the same issue on my production webserver, but not on the development webserver. I find that odd. It tries to drop all foreign keys and create them again, although without the CHANGE statement you are referring to, Dmitry. |
| Comment by Benjamin Eberlei [ 09/Jan/12 ] |
|
This maybe fixable by making a hash out of the column definition and saving it into a database comment. The Foreign Key problem maybe because of an old MySQL version 5.0.x |
| Comment by Joe Cai [ 16/Jul/12 ] |
|
@beberlei, sounds good to me. any plan of implementing this? |
[DBAL-297] PDO::PARAM_LOB (value=3) overlaps with PDO::FETCH_NUM (value=3) in OCI8Statement::$fetchModeMap Created: 05/Jul/12 Updated: 05/Jul/12 |
|
| Status: | Open |
| Project: | Doctrine DBAL |
| Component/s: | Drivers |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Minor |
| Reporter: | Charles Gunawan | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
N/A |
||
| Description |
|
Hi, In OCI8Statement, using PDO::FETCH_NUM does not work because the fetch style mapping is overwritten by PDO::PARAM_LOB since the two has the same value (3); protected static $fetchModeMap = array( so PDO::FETCH_NUM is mapped to OCI_B_BLOB |
[DBAL-7] Add support for char fields in the ORM layer Created: 24/Jan/10 Updated: 17/Sep/11 |
|
| Status: | Open |
| Project: | Doctrine DBAL |
| Component/s: | Drivers, Platforms, Schema Managers |
| Affects Version/s: | 2.1, 2.1.1, 2.1.2 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Glen Ainscow | Assignee: | Roman S. Borschel |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
It's not possible to use char fields in the ORM layer. It should be possible to use something like: @Column(type="char") or ... |
| Comments |
| Comment by Roman S. Borschel [ 24/Jan/10 ] |
|
I dont think this is worth including in the main distribution. A char does not save much compared to a varchar (1 Byte?) and you already have 2 options to make a char:
IMHO, just use a string type with the length you want: @Column(type="string", length=2). That becomes a varchar with length 2. |
| Comment by Glen Ainscow [ 24/Jan/10 ] |
|
Ya, it is only 1 extra byte. I'm not sure what to do, I like things as optimized as possible, but I guess I could just use columnDefinition if necessary. |
| Comment by Glen Ainscow [ 24/Jan/10 ] |
|
Actually, I don't really see any reason not to include the char type. |
| Comment by Roman S. Borschel [ 24/Jan/10 ] |
|
How about code bloat? |
| Comment by Glen Ainscow [ 24/Jan/10 ] |
|
How many LoC? |
| Comment by Guilherme Blanco [ 25/Jan/10 ] |
|
@darkangel Around 40. And lots of conditionals, which decreases efficiency of algorithm. I vote for FixedString DBAL DataType. |
| Comment by Roman S. Borschel [ 25/Jan/10 ] |
|
We will not put every special data type someone comes up with in the core library. If we go this route, at the end we have 100+ data types (100+ classes plus a bloated type map) in the core library. There are at least 2 decent options of making a char already if you care about byte counting (see above). "Why not?" is not the question to ask for when it comes to new features. If it were, we would include a whole lot of stuff that is useless for 99% of the users. There must be strong arguments for "Why?" and there are none. If we get 50+ votes on this issue we can talk again. |
| Comment by Glen Ainscow [ 25/Jan/10 ] |
|
Of course not. I didn't know that char was a special data type (especially since it's supported in DC1.2). I will use @columnDefinition. You may close this issue. |
| Comment by Roman S. Borschel [ 25/Jan/10 ] |
|
No need to become defensive. There is still the chance that demand for this particular type gets very high and that can change things. Thats why this stays open. Otherwise the next guy would probably just create a duplicate ticket (not sure whether non-owners can reopen other tickets). |
| Comment by Benjamin Eberlei [ 25/Jan/10 ] |
|
@Glen The problem with Doctrine 1 and having lots of different data-types is that of maintainability. You have to ensure that all the types work on all supported platforms with each and every version. The more datatypes we support by default the more complex will it be for the Doctrine 2 Core to ensure compability and maintainability in this regard. For each new platform that we will support all datatypes have to be supported for example, something that might even become impossible for some databases. Adding a datatype from the user perspective is rather simple though, it has to be tested once and is only about 20-40 LOC. I bet you 100 bucks that soon there will be code-snippets out there on all the different database specific types as a doctrine 2 implemention. |
| Comment by Glen Ainscow [ 25/Jan/10 ] |
|
@Roman @Benamin Thanks. |
| Comment by Dmitry Strygin [ 17/Sep/11 ] |
|
Sorry for party rocking but i think that 'fixed' annotation should be enabled in ORM column definitions. |
[DBAL-375] Warning "Udefined index dbname" while creating database with oci8 driver Created: 31/Oct/12 Updated: 20/Apr/13 |
|
| Status: | Open |
| Project: | Doctrine DBAL |
| Component/s: | Drivers |
| Affects Version/s: | 2.2.2, 2.3.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | pavel patrin | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | dbname, oci8 | ||
| Description |
|
In config specified: doctrine: When i create database (with symfony 2, doctrine:database:create), got that error: ===================================== If i comment "unset($params['dbname'])" in CreateDatabaseDoctrineCommand.php:54 all works fine. |
| Comments |
| Comment by Kris Willis [ 13/Nov/12 ] |
|
I'm experiencing the same issue and your fix appears to work for me too; thanks! |
| Comment by Benjamin Eberlei [ 20/Apr/13 ] |
|
on Oracle CREATE DATABASE is actually a CREATE USER. I am not sure the command should allow to do this. |