Skip to content

Loading…

DBAL-508: MySqlSchemaManager accessing undefined index tableColumn[comment] #1712

Closed
doctrinebot opened this Issue · 4 comments

2 participants

@doctrinebot

Jira issue originally created by user mkuckert:

in the method Doctrine\DBAL\Schema\MySqlSchemaManager::getPortableTableColumnDefinition the index "comment" in the array $tableColumn is accessed without ensuring that this index is set. This leads to an Undefined index: comment warning in EALL-environments.

This method is triggered e.g. by the Doctrine\ORM\Tools\SchemaTool getUpdateSchemaSql method.

@doctrinebot

Comment created by @beberlei:

Can't really explain this, the key has to be existant. This is only called with information from MysqlPlatform#getListTableColumnsSQL().

@doctrinebot

Comment created by mkuckert:

I've just found the issue. The main problem is the usage of 'DESCRIBE ' . $table; in the getListTableColumnsSQL, if there's no $database set. describe does not return the comment column, but 'show full columns from ' . $table; does.
At the basis of the missing $database value was my own DBAL\Driver implementation not properly returning the currently connected database. So $database was NULL and the alternate code path was executed, so resulting in no comment-property.

Seems like an uncovered code path instead of a bug in a real environment.

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot

Comment created by @beberlei:

Special case fixed for 2.4

@doctrinebot doctrinebot added the Bug label
@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.4 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.