Bug 1313309 - Remove getColumnDecltype and compile with SQLITE_OMIT_DECLTYPE. r=asuth draft
authorMarco Bonardo <mbonardo@mozilla.com>
Thu, 03 Nov 2016 21:04:00 +0100
changeset 433478 37ed75d0cf724a6c373df6d12df1f36fddc0a646
parent 433471 766b43eb8c3c189514a327d39aaafdd93a5856f4
child 535906 356527ba52ecd723801e95756a07e1053b836ccc
push id34598
push usermak77@bonardo.net
push dateThu, 03 Nov 2016 20:08:56 +0000
reviewersasuth
bugs1313309
milestone52.0a1
Bug 1313309 - Remove getColumnDecltype and compile with SQLITE_OMIT_DECLTYPE. r=asuth MozReview-Commit-ID: 2QR8P7ylg9m
db/sqlite3/src/moz.build
db/sqlite3/src/sqlite.symbols
storage/mozIStorageStatement.idl
storage/mozStorageStatement.cpp
storage/test/unit/test_storage_statement.js
--- a/db/sqlite3/src/moz.build
+++ b/db/sqlite3/src/moz.build
@@ -78,15 +78,16 @@ if CONFIG['OS_TARGET'] == 'Android':
 # causes assertions on Win64. See bug 719579.
 if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['MOZ_MEMORY']:
     DEFINES['HAVE_MALLOC_USABLE_SIZE'] = True
     DEFINES['SQLITE_WITHOUT_MSIZE'] = True
 
 # Omit unused functions to save some library footprint.
 DEFINES['SQLITE_OMIT_DEPRECATED'] = True
 DEFINES['SQLITE_OMIT_BUILTIN_TEST'] = True
+DEFINES['SQLITE_OMIT_DECLTYPE'] = True
 
 # Suppress warnings in third-party code.
 if CONFIG['GNU_CC']:
     CFLAGS += [
         '-Wno-sign-compare',
         '-Wno-type-limits',
     ]
--- a/db/sqlite3/src/sqlite.symbols
+++ b/db/sqlite3/src/sqlite.symbols
@@ -22,18 +22,16 @@ sqlite3_changes
 sqlite3_clear_bindings
 sqlite3_close
 sqlite3_collation_needed
 sqlite3_collation_needed16
 sqlite3_column_blob
 sqlite3_column_bytes
 sqlite3_column_bytes16
 sqlite3_column_count
-sqlite3_column_decltype
-sqlite3_column_decltype16
 sqlite3_column_double
 sqlite3_column_int
 sqlite3_column_int64
 sqlite3_column_name
 sqlite3_column_name16
 sqlite3_column_text
 sqlite3_column_text16
 sqlite3_column_type
--- a/storage/mozIStorageStatement.idl
+++ b/storage/mozIStorageStatement.idl
@@ -61,26 +61,16 @@ interface mozIStorageStatement : mozISto
    *
    * @param aName
    *        The name of the column.
    * @return The index of the column with the specified name.
    */
   unsigned long getColumnIndex(in AUTF8String aName);
 
   /**
-   * Obtains the declared column type of a prepared statement.
-   *
-   * @param aParamIndex
-   *        The zero-based index of the column who's declared type we are
-   *        interested in.
-   * @return the declared index type.
-   */
-  AUTF8String getColumnDecltype(in unsigned long aParamIndex);
-
-  /**
    * Reset parameters/statement execution
    */
   void reset();
 
   /**
    * Execute the query, ignoring any results.  This is accomplished by
    * calling executeStep() once, and then calling reset().
    *
--- a/storage/mozStorageStatement.cpp
+++ b/storage/mozStorageStatement.cpp
@@ -647,29 +647,16 @@ Statement::GetState(int32_t *_state)
   else if (mExecuting)
     *_state = MOZ_STORAGE_STATEMENT_EXECUTING;
   else
     *_state = MOZ_STORAGE_STATEMENT_READY;
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-Statement::GetColumnDecltype(uint32_t aParamIndex,
-                             nsACString &_declType)
-{
-  if (!mDBStatement)
-    return NS_ERROR_NOT_INITIALIZED;
-
-  ENSURE_INDEX_VALUE(aParamIndex, mResultColumnCount);
-
-  _declType.Assign(::sqlite3_column_decltype(mDBStatement, aParamIndex));
-  return NS_OK;
-}
-
 ////////////////////////////////////////////////////////////////////////////////
 //// mozIStorageValueArray (now part of mozIStorageStatement too)
 
 NS_IMETHODIMP
 Statement::GetNumEntries(uint32_t *_length)
 {
   *_length = mResultColumnCount;
   return NS_OK;
--- a/storage/test/unit/test_storage_statement.js
+++ b/storage/test/unit/test_storage_statement.js
@@ -125,30 +125,16 @@ function test_state_executing()
 function test_state_after_finalize()
 {
   var stmt = createStatement("SELECT name, id FROM test");
   stmt.executeStep();
   stmt.finalize();
   do_check_eq(Ci.mozIStorageStatement.MOZ_STORAGE_STATEMENT_INVALID, stmt.state);
 }
 
-function test_getColumnDecltype()
-{
-  var stmt = createStatement("SELECT name, id FROM test");
-  do_check_eq("TEXT", stmt.getColumnDecltype(0));
-  do_check_eq("INTEGER", stmt.getColumnDecltype(1));
-  try {
-    do_check_eq("GARBAGE", stmt.getColumnDecltype(2));
-    do_throw("should not get here");
-  } catch (e) {
-    do_check_eq(Cr.NS_ERROR_ILLEGAL_VALUE, e.result);
-  }
-  stmt.finalize();
-}
-
 function test_failed_execute()
 {
   var stmt = createStatement("INSERT INTO test (name) VALUES ('foo')");
   stmt.execute();
   stmt.finalize();
   var id = getOpenedDatabase().lastInsertRowID;
   stmt = createStatement("INSERT INTO test(id, name) VALUES(:id, 'bar')");
   stmt.params.id = id;
@@ -176,17 +162,16 @@ function test_bind_undefined()
 }
 
 var tests = [test_parameterCount_none, test_parameterCount_one,
              test_getParameterName, test_getParameterIndex_different,
              test_getParameterIndex_same, test_columnCount,
              test_getColumnName, test_getColumnIndex_same_case,
              test_getColumnIndex_different_case, test_state_ready,
              test_state_executing, test_state_after_finalize,
-             test_getColumnDecltype,
              test_failed_execute,
              test_bind_undefined,
 ];
 
 function run_test()
 {
   setup();