Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
5.5.0, 5.11.2
-
None
-
Windows 8.1 64-bit with MSVC2013, OS X 10.10 with Xcode 7 and Mint Linux 17.2
Description
When using the following passing in a QString (see below) into QSqlQuery::prepare and then calling QSqlQuery::exec with no arguments we get a postgresql error 42601. However passing the same QString into the QSqlQuery::exec and skipping the QSqlQuery::prepare step functions correctly with no errors.
**** ERROR: int mCategoryNumber = 123; QSqlDatabase mDatabase = ...; QSqlQuery lCQuery(mDatabase); QString lCSql = QString( "CREATE TABLE IF NOT EXISTS category_%1 (" " sn SERIAL PRIMARY KEY," " istrial int," " maintexpiration TEXT," " creation TEXT," " expiration TEXT," " lastissue TEXT," " certificate TEXT," " privatekey TEXT," " name TEXT NOT NULL," " phone TEXT," " email TEXT NOT NULL," " notes TEXT," " organization TEXT," " organizationunit TEXT," " country TEXT," " licensetype int," " licensecount int );" ).arg(mCategoryNumber); lCQuery.prepare( lCSql ); return lCQuery.exec(); **** SUCCESSFUL: int mCategoryNumber = 123; QSqlDatabase mDatabase = ...; QSqlQuery lCQuery(mDatabase); QString lCSql = QString( "CREATE TABLE IF NOT EXISTS category_%1 (" " sn SERIAL PRIMARY KEY," " istrial int," " maintexpiration TEXT," " creation TEXT," " expiration TEXT," " lastissue TEXT," " certificate TEXT," " privatekey TEXT," " name TEXT NOT NULL," " phone TEXT," " email TEXT NOT NULL," " notes TEXT," " organization TEXT," " organizationunit TEXT," " country TEXT," " licensetype int," " licensecount int );" ).arg(mCategoryNumber); return lCQuery.exec(lCSql);
Attachments
Issue Links
- relates to
-
QTBUG-70928 QSqlQuery constructor unusable with QPSQL driver
-
- Closed
-