DDC-186: addIndex is borken in trunk since this morning update #229

Closed
opened 2026-01-22 12:31:38 +01:00 by admin · 13 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 30, 2009).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user rickdt:

Warning: Illegal offset type in isset or empty in /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/DBAL/Schema/Table.php on line 183

Call Stack:
    0.0003     328176   1. {main}() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/scripts/tool.php:0
    0.0046     708968   2. Kronos\Common\ToolRunner->run() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/scripts/tool.php:31
    0.0094     990020   3. Kronos\Common\Tool->run() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Kronos/Common/ToolRunner.php:92
    0.0094     990020   4. Kronos\FNA\Tool\CreateDatabase->runTool() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Kronos/Common/Tool.php:223
    0.0094     990020   5. Kronos\FNA\Tool\CreateDatabase::CreateDatabase() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/Kronos/FNA/Tool/CreateDatabase.php:18
    0.7140   10032764   6. Doctrine\ORM\Tools\SchemaTool->createSchema() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/Kronos/FNA/Tool/CreateDatabase.php:45
    0.7140   10032764   7. Doctrine\ORM\Tools\SchemaTool->getCreateSchemaSql() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php:81
    0.7140   10032764   8. Doctrine\ORM\Tools\SchemaTool->getSchemaFromMetadata() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php:98
    0.7184   10339688   9. Doctrine\DBAL\Schema\Table->addIndex() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php:197
    0.7184   10339744  10. Doctrine\DBAL\Schema\Table->_createIndex() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/DBAL/Schema/Table.php:150

Originally created by @doctrinebot on GitHub (Nov 30, 2009). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user rickdt: ``` Warning: Illegal offset type in isset or empty in /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/DBAL/Schema/Table.php on line 183 Call Stack: 0.0003 328176 1. {main}() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/scripts/tool.php:0 0.0046 708968 2. Kronos\Common\ToolRunner->run() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/scripts/tool.php:31 0.0094 990020 3. Kronos\Common\Tool->run() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Kronos/Common/ToolRunner.php:92 0.0094 990020 4. Kronos\FNA\Tool\CreateDatabase->runTool() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Kronos/Common/Tool.php:223 0.0094 990020 5. Kronos\FNA\Tool\CreateDatabase::CreateDatabase() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/Kronos/FNA/Tool/CreateDatabase.php:18 0.7140 10032764 6. Doctrine\ORM\Tools\SchemaTool->createSchema() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/Kronos/FNA/Tool/CreateDatabase.php:45 0.7140 10032764 7. Doctrine\ORM\Tools\SchemaTool->getCreateSchemaSql() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php:81 0.7140 10032764 8. Doctrine\ORM\Tools\SchemaTool->getSchemaFromMetadata() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php:98 0.7184 10339688 9. Doctrine\DBAL\Schema\Table->addIndex() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php:197 0.7184 10339744 10. Doctrine\DBAL\Schema\Table->_createIndex() /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/DBAL/Schema/Table.php:150 ```
admin added the Bug label 2026-01-22 12:31:38 +01:00
admin closed this issue 2026-01-22 12:31:38 +01:00
Author
Owner

@doctrinebot commented on GitHub (Nov 30, 2009):

Comment created by @beberlei:

This happens because of the totally unused syntax:

$indexColumns = array("foo" => array(), "bar" => array());

This syntax was removed in favour of:

$indexColumns = array("foo", "bar");
@doctrinebot commented on GitHub (Nov 30, 2009): Comment created by @beberlei: This happens because of the totally unused syntax: ``` $indexColumns = array("foo" => array(), "bar" => array()); ``` This syntax was removed in favour of: ``` $indexColumns = array("foo", "bar"); ```
Author
Owner

@doctrinebot commented on GitHub (Nov 30, 2009):

Comment created by rickdt:

How do we use this syntax in Metadata ??

I do ;

@Table(name="xxxxxxx",indexes={@index(name="idx*record_id", columns={"record*id"})})
@doctrinebot commented on GitHub (Nov 30, 2009): Comment created by rickdt: How do we use this syntax in Metadata ?? I do ; ``` @Table(name="xxxxxxx",indexes={@index(name="idx*record_id", columns={"record*id"})}) ```
Author
Owner

@doctrinebot commented on GitHub (Nov 30, 2009):

Comment created by rickdt:

..

@doctrinebot commented on GitHub (Nov 30, 2009): Comment created by rickdt: ..
Author
Owner

@doctrinebot commented on GitHub (Nov 30, 2009):

Comment created by rickdt:

I really would like to use the good syntax. I even asked for a better documentation in DDC-160

@doctrinebot commented on GitHub (Nov 30, 2009): Comment created by rickdt: I really would like to use the good syntax. I even asked for a better documentation in [DDC-160](http://www.doctrine-project.org/jira/browse/DDC-160)
Author
Owner

@doctrinebot commented on GitHub (Nov 30, 2009):

Comment created by @beberlei:

Hm it seems the metadata drivers make this. This only means index creation is not tested in the unittests :-)

I'll add a temporary fix, and discuss it in the team how to solve this consistently.

@doctrinebot commented on GitHub (Nov 30, 2009): Comment created by @beberlei: Hm it seems the metadata drivers make this. This only means index creation is not tested in the unittests :-) I'll add a temporary fix, and discuss it in the team how to solve this consistently.
Author
Owner

@doctrinebot commented on GitHub (Nov 30, 2009):

Comment created by @beberlei:

Can you try again with trunk?

@doctrinebot commented on GitHub (Nov 30, 2009): Comment created by @beberlei: Can you try again with trunk?
Author
Owner

@doctrinebot commented on GitHub (Dec 1, 2009):

Comment created by rickdt:

There is a new error

An unknown column-name columns was given.
#0 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/DBAL/Schema/Table.php(188): Doctrine\DBAL\Schema\SchemaException::columnDoesNotExist('columns')
#1 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/DBAL/Schema/Table.php(150): Doctrine\DBAL\Schema\Table->*createIndex(Array, 'idx_record*id', false, false)
#2 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php(197): Doctrine\DBAL\Schema\Table->addIndex(Array, 'idx*record*id')
#3 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php(98): Doctrine\ORM\Tools\SchemaTool->getSchemaFromMetadata(Array)
#4 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php(81): Doctrine\ORM\Tools\SchemaTool->getCreateSchemaSql(Array)
#5 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/Kronos/FNA/Tool/CreateDatabase.php(46): Doctrine\ORM\Tools\SchemaTool->createSchema(Array)

I will try to get you more informations.

@doctrinebot commented on GitHub (Dec 1, 2009): Comment created by rickdt: There is a new error ``` An unknown column-name columns was given. #0 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/DBAL/Schema/Table.php(188): Doctrine\DBAL\Schema\SchemaException::columnDoesNotExist('columns') #1 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/DBAL/Schema/Table.php(150): Doctrine\DBAL\Schema\Table->*createIndex(Array, 'idx_record*id', false, false) #2 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php(197): Doctrine\DBAL\Schema\Table->addIndex(Array, 'idx*record*id') #3 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php(98): Doctrine\ORM\Tools\SchemaTool->getSchemaFromMetadata(Array) #4 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/lib/Doctrine/ORM/Tools/SchemaTool.php(81): Doctrine\ORM\Tools\SchemaTool->getCreateSchemaSql(Array) #5 /home/eric/Zend/workspaces/DefaultWorkspace7/fna/application/Kronos/FNA/Tool/CreateDatabase.php(46): Doctrine\ORM\Tools\SchemaTool->createSchema(Array) ``` I will try to get you more informations.
Author
Owner

@doctrinebot commented on GitHub (Dec 1, 2009):

Comment created by rickdt:

Here is the content of columnNames

Array
(
    [0] => id
)
Array
(
    [columns] => Array
        (
            [0] => record_id
        )

)
@doctrinebot commented on GitHub (Dec 1, 2009): Comment created by rickdt: Here is the content of columnNames ``` Array ( [0] => id ) Array ( [columns] => Array ( [0] => record_id ) ) ```
Author
Owner

@doctrinebot commented on GitHub (Dec 1, 2009):

Comment created by rickdt:

After some verification all Mapping Driver generate the index definitions this way

if ($tableAnnot->indexes !== null) {
                foreach ($tableAnnot->indexes as $indexAnnot) {
                    $primaryTable['indexes'][$indexAnnot->name] = array('columns' => $indexAnnot->columns);
                }
            }
@doctrinebot commented on GitHub (Dec 1, 2009): Comment created by rickdt: After some verification all Mapping Driver generate the index definitions this way ``` if ($tableAnnot->indexes !== null) { foreach ($tableAnnot->indexes as $indexAnnot) { $primaryTable['indexes'][$indexAnnot->name] = array('columns' => $indexAnnot->columns); } } ```
Author
Owner

@doctrinebot commented on GitHub (Dec 1, 2009):

Comment created by @beberlei:

Ok, that could be changed easily i guess.

@doctrinebot commented on GitHub (Dec 1, 2009): Comment created by @beberlei: Ok, that could be changed easily i guess.
Author
Owner

@doctrinebot commented on GitHub (Dec 4, 2009):

Comment created by @beberlei:

Fixed, added a test-case.

@doctrinebot commented on GitHub (Dec 4, 2009): Comment created by @beberlei: Fixed, added a test-case.
Author
Owner

@doctrinebot commented on GitHub (Dec 4, 2009):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Dec 4, 2009): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Dec 4, 2009):

Comment created by rickdt:

Thank you! I confirm this fixed the issue.

@doctrinebot commented on GitHub (Dec 4, 2009): Comment created by rickdt: Thank you! I confirm this fixed the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#229