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

Implement MySqlCommand.Prepare #397

Closed
bgrainger opened this issue Nov 14, 2017 · 4 comments
Closed

Implement MySqlCommand.Prepare #397

bgrainger opened this issue Nov 14, 2017 · 4 comments
Assignees
Milestone

Comments

@bgrainger
Copy link
Member

MySqlCommand.Prepare is currently unimplemented:

  1. Only a subset of statements are actually preparable by the server: http://dev.mysql.com/worklog/task/?id=2871
  2. Although CLIENT_MULTI_STATEMENTS is supposed to mean that the Server "Can handle multiple statements per COM_QUERY and COM_STMT_PREPARE" (https://dev.mysql.com/doc/internals/en/capability-flags.html#flag-CLIENT_MULTI_STATEMENTS), this is not actually true because "Prepared statement handles are defined to work only with strings that contain a single statement" (http://dev.mysql.com/doc/refman/5.7/en/c-api-multiple-queries.html).

Connector/NET has a IgnorePrepare connection string setting that defaults to true; unless the user explicitly sets that to false then its Prepare method also does nothing.

  • Determine how best to handle Prepare (e.g., accept the client's SQL as-is and let them be responsible for knowing server's limitations; or, break the command into individual statements, divide up the parameters and prepare them individually).
  • Determine if IgnorePrepare option should be supported, and its default value
@bgrainger
Copy link
Member Author

Add MySqlCommand.IsPrepared.

@bgrainger
Copy link
Member Author

#534 adds initial support: single statements, no stored procedures.

@bgrainger bgrainger self-assigned this Jul 24, 2018
@bgrainger bgrainger added this to the 1.0 milestone Jul 24, 2018
@bgrainger
Copy link
Member Author

Determine how best to handle Prepare (e.g., accept the client's SQL as-is and let them be responsible for knowing server's limitations; or, break the command into individual statements, divide up the parameters and prepare them individually).

Will do the latter (breaking the command up into individual statements); however, the client will still need to be aware of statements that can be prepared.

Determine if IgnorePrepare option should be supported, and its default value

It will be supported, and default to true (same as Connector/NET).

@bgrainger
Copy link
Member Author

Prepare has been implemented for single commands for a while, and is now implemented for multiple commands as part of MySqlBatch (#650) in 0.57.0.

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

No branches or pull requests

1 participant