Ticket Change Details

Artifact ID: bb1f022b52c03b40c03eca1e0f83d0152fdf1e74c8762ca4a14e949ccfdf0be2
Ticket: 8075e2d150258d4c9c77c9f7650b7861edc5c8f6
Bug found when execute(...) with template query
User & Date: anonymous 2018-12-20 09:13:04

  1. Change foundin to "mysql++-3.2.4"
  2. Change icomment to:

    MySQL version: mysql-5.7.23-win32 OS: Windows 10 1809 Visual Studio: vs2015 update 3

    I built mysql++-3.2.4 in its vc2005 project and got the x86 lib. I did some modification in the resetdb.cpp and ran the resetdb project, then I found a problem.

    ``` // Now create empty images table, for testing BLOB and auto- // increment column features. cout << "Creating empty images table..." << endl; query.reset(); // forget template query info query << "CREATE TABLE images (" << " id INT UNSIGNED AUTO_INCREMENT, " << " data BLOB, " << " PRIMARY KEY (id)" << ")"; query.execute(); query.execute( "insert into images (data) values (\"def\")");

    query << "insert into %1:tab (%2:field) values (%0q:val1)"; //query << "insert into %0:table values (\"def\")"; query.parse(); query.template_defaults["tab"] = "images"; query.template_defaults["field"] = "data"; query.template_defaults["val1"] = "abc"; //query.template_defaults["field"] = "data"; cout << query.str() << endl; query.execute("abc", "images"); query.execute("images"); query.reset(); ```
    A BadQuery was caught when executing `query.execute("images");`. I debuged and waited in mysql_real_query(...), then I found that the `qstr` is "images".
    I think it's something wrong when there're more than one placeholder but pass only one parameter into execute(...).
    If it's not a bug, please give me some advice on how to do in this situation.
  3. Change login to "anonymous"
  4. Change mimetype to "text/x-fossil-plain"
  5. Change private_contact to "0efae30de6243cd4e4a987402a972c4d3d740c40"
  6. Change severity to "Important"
  7. Change status to "Open"
  8. Change title to "Bug found when execute(...) with template query"
  9. Change type to "Code Defect"