Bug #1946 You can always mysql_real_query a query with placeholders after mysql_prepare()

Submitted: 25 Nov 2003 6:38 Modified: 26 Nov 2003 12:11
Reporter: Konstantin Osipov (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1 OS:Any (all)
Assigned to: Konstantin Osipov CPU Architecture:Any

[25 Nov 2003 6:38] Konstantin Osipov
Description:
  const char *query= "INSERT INTO prepare_command VALUES (?)";

  stmt = mysql_prepare(mysql, query, strlen(query));
  mystmt_init(stmt);
  rc= mysql_real_query(mysql, query, strlen(query));
  assert(rc != 0);

assertion fails 

How to repeat:
issue C API calls mentioned above having prepare_command table like 
CREATE TABLE prepare_command (id int)

Suggested fix:
Eliminate THD::prepare_command and use THD->command for checks in sql_yacc.yy
[26 Nov 2003 12:11] Konstantin Osipov
Fixed in 4.1.1, ChangeSet (konstantin:1.1639)

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.