Documentation Home
MySQL Internals Manual
Download this Manual
EPUB - 0.8Mb


14.7.4 COM_STMT_PREPARE

COM_STMT_PREPARE creates a prepared statement from the passed query string.

The server returns a COM_STMT_PREPARE Response which contains a statement-id which is used to identify the prepared statement.

COM_STMT_PREPARE:

create a prepared statement

Fields
  • command (1) -- [16] the COM_STMT_PREPARE command

  • query (string.EOF) -- the query to prepare

Example
1c 00 00 00 16 53 45 4c    45 43 54 20 43 4f 4e 43    .....SELECT CONC
41 54 28 3f 2c 20 3f 29    20 41 53 20 63 6f 6c 31    AT(?, ?) AS col1
Implemented By

mysqld_stmt_prepare()

Return

COM_STMT_PREPARE_OK on success, ERR_Packet otherwise

Note

As LOAD DATA isn't supported by COM_STMT_PREPARE yet, no Protocol::LOCAL_INFILE_Request is expected here. Compare this to COM_QUERY_Response.


User Comments
Sign Up Login You must be logged in to post a comment.