Skip to content
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

MySQL MetaColumns() behavior. #253

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gohanman
Copy link
Contributor

Currently the mysql and pdo_mysql drivers will check for a schema in the argument and if found will change the connection's selected schema, get the table information, and change the connection's selected schema back. I think that's unnecessarily complicated. Manipulating the state of the connection creates the possibility of giving it back to the caller in a different state and it's not strictly necessary anyway. This change also detects a schema in the argument but modifies the metaColumnsSQL string rather than modifying the connection.

I added the same behavior for mysqli because it seemed strange for only 2 out of 3 options to support "schema.table" syntax.

MetaColumns is called. Besides eliminating a pair of
queries (albeit very cheap ones), it reduces the chances
of MetaColumns silently altering the connection state in
the event of an error.

I added the same behavior for mysqli because it seemed
strange for only 2/3 options to support "schema.table"
syntax.
Copy link
Contributor

@mnewnham mnewnham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants