Skip to content

Commit d2803b6

Browse files
author
homann
committedAug 19, 2009
Fix a length computation error when doing SQL query with non-ASCII characters
git-svn-id: http://svn.osgeo.org/qgis/trunk@11436 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 9f47660 commit d2803b6

File tree

8 files changed

+39
-39
lines changed

8 files changed

+39
-39
lines changed
 

‎src/app/qgsbookmarks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void QgsBookmarks::initialise()
9292
sqlite3_stmt *ppStmt;
9393
QString sql = "select * from tbl_bookmarks";
9494

95-
rc = sqlite3_prepare( db, sql.toUtf8(), sql.length(), &ppStmt, &pzTail );
95+
rc = sqlite3_prepare( db, sql.toUtf8(), sql.toUtf8().length(), &ppStmt, &pzTail );
9696
// XXX Need to free memory from the error msg if one is set
9797
if ( rc == SQLITE_OK )
9898
{
@@ -213,7 +213,7 @@ void QgsBookmarks::zoomToBookmark()
213213
const char *pzTail;
214214
// build the sql statement
215215
QString sql = "select xmin, ymin, xmax, ymax from tbl_bookmarks where bookmark_id = " + item->text( 3 );
216-
rc = sqlite3_prepare( db, sql.toUtf8(), sql.length(), &ppStmt, &pzTail );
216+
rc = sqlite3_prepare( db, sql.toUtf8(), sql.toUtf8().length(), &ppStmt, &pzTail );
217217
if ( rc == SQLITE_OK )
218218
{
219219
if ( sqlite3_step( ppStmt ) == SQLITE_ROW )

‎src/app/qgscustomprojectiondialog.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ void QgsCustomProjectionDialog::on_pbnDelete_clicked()
191191
}
192192
// Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
193193
QString mySql = "delete from tbl_srs where srs_id='" + mCurrentRecordId + "'";
194-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
194+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
195195
// XXX Need to free memory from the error msg if one is set
196196
QgsDebugMsg( QString( "Query to delete current:%1" ).arg( mySql ) );
197197
if ( myResult == SQLITE_OK )
@@ -249,7 +249,7 @@ long QgsCustomProjectionDialog::getRecordCount()
249249
}
250250
// Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
251251
QString mySql = "select count(*) from tbl_srs";
252-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
252+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
253253
// XXX Need to free memory from the error msg if one is set
254254
if ( myResult == SQLITE_OK )
255255
{
@@ -284,7 +284,7 @@ QString QgsCustomProjectionDialog::getProjectionFamilyName( QString theProjectio
284284
}
285285
// Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
286286
QString mySql = "select name from tbl_projection where acronym='" + theProjectionFamilyAcronym + "'";
287-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
287+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
288288
// XXX Need to free memory from the error msg if one is set
289289
if ( myResult == SQLITE_OK )
290290
{
@@ -315,7 +315,7 @@ QString QgsCustomProjectionDialog::getEllipsoidName( QString theEllipsoidAcronym
315315
}
316316
// Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
317317
QString mySql = "select name from tbl_ellipsoid where acronym='" + theEllipsoidAcronym + "'";
318-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
318+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
319319
// XXX Need to free memory from the error msg if one is set
320320
if ( myResult == SQLITE_OK )
321321
{
@@ -346,7 +346,7 @@ QString QgsCustomProjectionDialog::getProjectionFamilyAcronym( QString theProjec
346346
}
347347
// Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
348348
QString mySql = "select acronym from tbl_projection where name='" + theProjectionFamilyName + "'";
349-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
349+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
350350
// XXX Need to free memory from the error msg if one is set
351351
if ( myResult == SQLITE_OK )
352352
{
@@ -377,7 +377,7 @@ QString QgsCustomProjectionDialog::getEllipsoidAcronym( QString theEllipsoidName
377377
}
378378
// Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
379379
QString mySql = "select acronym from tbl_ellipsoid where name='" + theEllipsoidName + "'";
380-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
380+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
381381
// XXX Need to free memory from the error msg if one is set
382382
if ( myResult == SQLITE_OK )
383383
{
@@ -410,7 +410,7 @@ void QgsCustomProjectionDialog::on_pbnFirst_clicked()
410410

411411
QString mySql = "select * from tbl_srs order by srs_id limit 1";
412412
QgsDebugMsg( QString( "Query to move first:%1" ).arg( mySql ) );
413-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
413+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
414414
// XXX Need to free memory from the error msg if one is set
415415
if ( myResult == SQLITE_OK )
416416
{
@@ -482,7 +482,7 @@ void QgsCustomProjectionDialog::on_pbnPrevious_clicked()
482482

483483
QString mySql = "select * from tbl_srs where srs_id < " + mCurrentRecordId + " order by srs_id desc limit 1";
484484
QgsDebugMsg( QString( "Query to move previous:%1" ).arg( mySql ) );
485-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
485+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
486486
// XXX Need to free memory from the error msg if one is set
487487
if ( myResult == SQLITE_OK )
488488
{
@@ -555,7 +555,7 @@ void QgsCustomProjectionDialog::on_pbnNext_clicked()
555555

556556
QString mySql = "select * from tbl_srs where srs_id > " + mCurrentRecordId + " order by srs_id asc limit 1";
557557
QgsDebugMsg( QString( "Query to move next:%1" ).arg( mySql ) );
558-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
558+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
559559
// XXX Need to free memory from the error msg if one is set
560560
if ( myResult == SQLITE_OK )
561561
{
@@ -624,7 +624,7 @@ void QgsCustomProjectionDialog::on_pbnLast_clicked()
624624

625625
QString mySql = "select * from tbl_srs order by srs_id desc limit 1";
626626
QgsDebugMsg( QString( "Query to move last:%1" ).arg( mySql ) );
627-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
627+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
628628
// XXX Need to free memory from the error msg if one is set
629629
if ( myResult == SQLITE_OK )
630630
{
@@ -842,7 +842,7 @@ void QgsCustomProjectionDialog::on_pbnSave_clicked()
842842
assert( myResult == SQLITE_OK );
843843
}
844844
QgsDebugMsg( QString( "Update or insert sql \n%1" ).arg( mySql ) );
845-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
845+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
846846
sqlite3_step( myPreparedStatement );
847847
// XXX Need to free memory from the error msg if one is set
848848
if ( myResult != SQLITE_OK )

‎src/app/qgsoptions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ void QgsOptions::getEllipsoidList()
567567

568568
// Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
569569
QString mySql = "select * from tbl_ellipsoid order by name";
570-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
570+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
571571
// XXX Need to free memory from the error msg if one is set
572572
if ( myResult == SQLITE_OK )
573573
{
@@ -599,7 +599,7 @@ QString QgsOptions::getEllipsoidAcronym( QString theEllipsoidName )
599599
}
600600
// Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
601601
QString mySql = "select acronym from tbl_ellipsoid where name='" + theEllipsoidName + "'";
602-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
602+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
603603
// XXX Need to free memory from the error msg if one is set
604604
if ( myResult == SQLITE_OK )
605605
{
@@ -631,7 +631,7 @@ QString QgsOptions::getEllipsoidName( QString theEllipsoidAcronym )
631631
}
632632
// Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
633633
QString mySql = "select name from tbl_ellipsoid where acronym='" + theEllipsoidAcronym + "'";
634-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
634+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
635635
// XXX Need to free memory from the error msg if one is set
636636
if ( myResult == SQLITE_OK )
637637
{

‎src/core/qgscoordinatereferencesystem.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ bool QgsCoordinateReferenceSystem::loadFromDb( QString db, QString field, long i
221221
*/
222222

223223
QString mySql = "select srs_id,description,projection_acronym,ellipsoid_acronym,parameters,srid,epsg,is_geo from tbl_srs where " + field + "='" + QString::number( id ) + "'";
224-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
224+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
225225
// XXX Need to free memory from the error msg if one is set
226226
if ( myResult == SQLITE_OK && sqlite3_step( myPreparedStatement ) == SQLITE_ROW )
227227
{
@@ -506,7 +506,7 @@ QgsCoordinateReferenceSystem::RecordMap QgsCoordinateReferenceSystem::getRecord(
506506
return myMap;
507507
}
508508

509-
myResult = sqlite3_prepare( myDatabase, theSql.toUtf8(), theSql.length(), &myPreparedStatement, &myTail );
509+
myResult = sqlite3_prepare( myDatabase, theSql.toUtf8(), theSql.toUtf8().length(), &myPreparedStatement, &myTail );
510510
// XXX Need to free memory from the error msg if one is set
511511
if ( myResult == SQLITE_OK && sqlite3_step( myPreparedStatement ) == SQLITE_ROW )
512512
{
@@ -542,7 +542,7 @@ QgsCoordinateReferenceSystem::RecordMap QgsCoordinateReferenceSystem::getRecord(
542542
return myMap;
543543
}
544544

545-
myResult = sqlite3_prepare( myDatabase, theSql.toUtf8(), theSql.length(), &myPreparedStatement, &myTail );
545+
myResult = sqlite3_prepare( myDatabase, theSql.toUtf8(), theSql.toUtf8().length(), &myPreparedStatement, &myTail );
546546
// XXX Need to free memory from the error msg if one is set
547547
if ( myResult == SQLITE_OK && sqlite3_step( myPreparedStatement ) == SQLITE_ROW )
548548
{
@@ -799,7 +799,7 @@ long QgsCoordinateReferenceSystem::findMatchingProj()
799799
return 0;
800800
}
801801

802-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
802+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
803803
// XXX Need to free memory from the error msg if one is set
804804
if ( myResult == SQLITE_OK )
805805
{
@@ -839,7 +839,7 @@ long QgsCoordinateReferenceSystem::findMatchingProj()
839839
return 0;
840840
}
841841

842-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
842+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
843843
// XXX Need to free memory from the error msg if one is set
844844
if ( myResult == SQLITE_OK )
845845
{
@@ -1088,7 +1088,7 @@ QString QgsCoordinateReferenceSystem::proj4FromSrsId( const int theSrsId )
10881088
const char *pzTail;
10891089
sqlite3_stmt *ppStmt;
10901090

1091-
rc = sqlite3_prepare( db, mySql.toUtf8(), mySql.length(), &ppStmt, &pzTail );
1091+
rc = sqlite3_prepare( db, mySql.toUtf8(), mySql.toUtf8().length(), &ppStmt, &pzTail );
10921092
// XXX Need to free memory from the error msg if one is set
10931093

10941094
if ( rc == SQLITE_OK )
@@ -1220,7 +1220,7 @@ bool QgsCoordinateReferenceSystem::saveAsUserCRS()
12201220
assert( myResult == SQLITE_OK );
12211221
}
12221222
QgsDebugMsg( QString( "Update or insert sql \n%1" ).arg( mySql ) );
1223-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
1223+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
12241224
sqlite3_step( myPreparedStatement );
12251225
// XXX Need to free memory from the error msg if one is set
12261226
return myResult == SQLITE_OK;
@@ -1245,7 +1245,7 @@ long QgsCoordinateReferenceSystem::getRecordCount()
12451245
}
12461246
// Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
12471247
QString mySql = "select count(*) from tbl_srs";
1248-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
1248+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
12491249
// XXX Need to free memory from the error msg if one is set
12501250
if ( myResult == SQLITE_OK )
12511251
{

‎src/core/qgsdistancearea.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ bool QgsDistanceArea::setEllipsoid( const QString& ellipsoid )
104104
}
105105
// Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
106106
QString mySql = "select radius, parameter2 from tbl_ellipsoid where acronym='" + ellipsoid + "'";
107-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
107+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
108108
// XXX Need to free memory from the error msg if one is set
109109
if ( myResult == SQLITE_OK )
110110
{

‎src/core/qgsmaplayer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ bool QgsMapLayer::loadNamedStyleFromDb( const QString db, const QString theURI,
493493
}
494494

495495
QString mySql = "select qml from tbl_styles where style=?";
496-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8().data(), mySql.length(), &myPreparedStatement, &myTail );
496+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8().data(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
497497
if ( myResult == SQLITE_OK )
498498
{
499499
QByteArray param = theURI.toUtf8();
@@ -655,7 +655,7 @@ QString QgsMapLayer::saveNamedStyle( const QString theURI, bool & theResultFlag
655655
QByteArray param1 = qml.toUtf8();
656656

657657
QString mySql = "create table if not exists tbl_styles(style varchar primary key,qml varchar)";
658-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8().data(), mySql.length(), &myPreparedStatement, &myTail );
658+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8().data(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
659659
if ( myResult == SQLITE_OK )
660660
{
661661
if ( sqlite3_step( myPreparedStatement ) != SQLITE_DONE )
@@ -670,7 +670,7 @@ QString QgsMapLayer::saveNamedStyle( const QString theURI, bool & theResultFlag
670670
sqlite3_finalize( myPreparedStatement );
671671

672672
mySql = "insert into tbl_styles(style,qml) values (?,?)";
673-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8().data(), mySql.length(), &myPreparedStatement, &myTail );
673+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8().data(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
674674
if ( myResult == SQLITE_OK )
675675
{
676676
if ( sqlite3_bind_text( myPreparedStatement, 1, param0.data(), param0.length(), SQLITE_STATIC ) == SQLITE_OK &&
@@ -687,7 +687,7 @@ QString QgsMapLayer::saveNamedStyle( const QString theURI, bool & theResultFlag
687687
if ( !theResultFlag )
688688
{
689689
QString mySql = "update tbl_styles set qml=? where style=?";
690-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8().data(), mySql.length(), &myPreparedStatement, &myTail );
690+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8().data(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
691691
if ( myResult == SQLITE_OK )
692692
{
693693
if ( sqlite3_bind_text( myPreparedStatement, 2, param0.data(), param0.length(), SQLITE_STATIC ) == SQLITE_OK &&

‎src/gui/qgsprojectionselector.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ QString QgsProjectionSelector::selectedProj4String()
454454

455455
QgsDebugMsg( "Selection sql: " + sql );
456456

457-
rc = sqlite3_prepare( db, sql.toUtf8(), sql.length(), &ppStmt, &pzTail );
457+
rc = sqlite3_prepare( db, sql.toUtf8(), sql.toUtf8().length(), &ppStmt, &pzTail );
458458
// XXX Need to free memory from the error msg if one is set
459459
QString myProjString;
460460
if ( rc == SQLITE_OK )
@@ -541,7 +541,7 @@ long QgsProjectionSelector::getSelectedLongAttribute( QString attributeName )
541541
sql += lvi->text( QGIS_CRS_ID_COLUMN );
542542

543543
QgsDebugMsg( QString( "Finding selected attribute using : %1" ).arg( sql ) );
544-
rc = sqlite3_prepare( db, sql.toUtf8(), sql.length(), &ppStmt, &pzTail );
544+
rc = sqlite3_prepare( db, sql.toUtf8(), sql.toUtf8().length(), &ppStmt, &pzTail );
545545
// XXX Need to free memory from the error msg if one is set
546546
QString myAttributeValue;
547547
if ( rc == SQLITE_OK )
@@ -657,7 +657,7 @@ void QgsProjectionSelector::loadUserCrsList( QSet<QString> * crsFilter )
657657
mySql += "where ";
658658
mySql += sqlFilter;
659659

660-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
660+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
661661
// XXX Need to free memory from the error msg if one is set
662662
if ( myResult == SQLITE_OK )
663663
{
@@ -736,7 +736,7 @@ void QgsProjectionSelector::loadCrsList( QSet<QString> * crsFilter )
736736
// get total count of records in the projection table
737737
QString sql = "select count(*) from tbl_srs";
738738

739-
rc = sqlite3_prepare( db, sql.toUtf8(), sql.length(), &ppStmt, &pzTail );
739+
rc = sqlite3_prepare( db, sql.toUtf8(), sql.toUtf8().length(), &ppStmt, &pzTail );
740740
assert( rc == SQLITE_OK );
741741
sqlite3_step( ppStmt );
742742

@@ -750,7 +750,7 @@ void QgsProjectionSelector::loadCrsList( QSet<QString> * crsFilter )
750750
sql += sqlFilter;
751751
sql += " order by name, description";
752752

753-
rc = sqlite3_prepare( db, sql.toUtf8(), sql.length(), &ppStmt, &pzTail );
753+
rc = sqlite3_prepare( db, sql.toUtf8(), sql.toUtf8().length(), &ppStmt, &pzTail );
754754
// XXX Need to free memory from the error msg if one is set
755755
if ( rc == SQLITE_OK )
756756
{
@@ -924,7 +924,7 @@ void QgsProjectionSelector::on_pbnFind_clicked()
924924
return;
925925
}
926926

927-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
927+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
928928
// XXX Need to free memory from the error msg if one is set
929929
if ( myResult == SQLITE_OK )
930930
{
@@ -956,7 +956,7 @@ void QgsProjectionSelector::on_pbnFind_clicked()
956956
return;
957957
}
958958

959-
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
959+
myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.toUtf8().length(), &myPreparedStatement, &myTail );
960960
// XXX Need to free memory from the error msg if one is set
961961
if ( myResult == SQLITE_OK )
962962
{
@@ -1004,7 +1004,7 @@ long QgsProjectionSelector::getLargestCRSIDMatch( QString theSql )
10041004
}
10051005
else
10061006
{
1007-
myResult = sqlite3_prepare( myDatabase, theSql.toUtf8(), theSql.length(), &myPreparedStatement, &myTail );
1007+
myResult = sqlite3_prepare( myDatabase, theSql.toUtf8(), theSql.toUtf8().length(), &myPreparedStatement, &myTail );
10081008
// XXX Need to free memory from the error msg if one is set
10091009
if ( myResult == SQLITE_OK )
10101010
{
@@ -1032,7 +1032,7 @@ long QgsProjectionSelector::getLargestCRSIDMatch( QString theSql )
10321032
return 0;
10331033
}
10341034

1035-
myResult = sqlite3_prepare( myDatabase, theSql.toUtf8(), theSql.length(), &myPreparedStatement, &myTail );
1035+
myResult = sqlite3_prepare( myDatabase, theSql.toUtf8(), theSql.toUtf8().length(), &myPreparedStatement, &myTail );
10361036
// XXX Need to free memory from the error msg if one is set
10371037
if ( myResult == SQLITE_OK )
10381038
{

‎src/helpviewer/qgshelpviewer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ void QgsHelpViewer::loadContextFromSqlite( const QString &contextId )
173173
// build the sql statement
174174
QString sql = "select content,title from context_helps where context_id = "
175175
+ contextId;
176-
rc = sqlite3_prepare( db, sql.toUtf8(), sql.length(), &ppStmt, &pzTail );
176+
rc = sqlite3_prepare( db, sql.toUtf8(), sql.toUtf8().length(), &ppStmt, &pzTail );
177177
if ( rc == SQLITE_OK )
178178
{
179179
if ( sqlite3_step( ppStmt ) == SQLITE_ROW )

0 commit comments

Comments
 (0)
Please sign in to comment.