<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>62129</bug_id>
          
          <creation_ts>2011-06-06 10:35:56 -0700</creation_ts>
          <short_desc>Assertion failure in SQLiteDatabase::turnOnIncrementalAutoVacuum()</short_desc>
          <delta_ts>2023-01-06 17:42:10 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Clifford Hung">chung</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>beidson</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>415884</commentid>
    <comment_count>0</comment_count>
    <who name="Clifford Hung">chung</who>
    <bug_when>2011-06-06 10:35:56 -0700</bug_when>
    <thetext>SQLiteDatabase::turnOnIncrementalAutoVacuum() runs the VACUUM command on a database and this will result in an assertion failure in SQLite&apos;s btree.c (found while using SQLite version 3.7.2):

assert( !pBt-&gt;pPage1 &amp;&amp; !pBt-&gt;pCursor ); in sqlite3BtreeSetPageSize(...)

This can be fixed by finalizing the statement that reads the auto_vacuum mode before running the VACUUM command as follows:

diff --git a/WebCore/platform/sql/SQLiteDatabase.cpp b/WebCore/platform/sql/SQLiteDatabase.cpp
index e7cef38..9d1bb34 100644
--- a/WebCore/platform/sql/SQLiteDatabase.cpp
+++ b/WebCore/platform/sql/SQLiteDatabase.cpp
@@ -444,6 +444,7 @@ bool SQLiteDatabase::turnOnIncrementalAutoVacuum()
     SQLiteStatement statement(*this, &quot;PRAGMA auto_vacuum&quot;);
     int autoVacuumMode = statement.getColumnInt(0);
     int error = lastError();
+    statement.finalize();

     // Check if we got an error while trying to get the value of the auto_vacuum flag.
     // If we got a SQLITE_BUSY error, then there&apos;s probably another transaction in</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1923700</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-01-06 17:42:10 -0800</bug_when>
    <thetext>WebKit SQLiteStatement implementation does not have &quot;finalize&quot; method, while possible potential error will be tracked via bug 249598.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>