Bug 1159303 - Reduce noise due to sort operations warnings. r=bent
authorMarco Bonardo <mbonardo@mozilla.com>
Tue, 28 Apr 2015 22:35:48 +0200
changeset 273001 2696c3d2ee5118bc1be664eb9528485584b58d8a
parent 273000 ff7b5b03fece6c5d2e3fee12cfe6311ad45be934
child 273002 dd8c914eb1f22ff9cccf1c1a1e46b7ad40ae00d4
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs1159303
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1159303 - Reduce noise due to sort operations warnings. r=bent
storage/src/mozStoragePrivateHelpers.cpp
--- a/storage/src/mozStoragePrivateHelpers.cpp
+++ b/storage/src/mozStoragePrivateHelpers.cpp
@@ -91,32 +91,28 @@ checkAndLogStatementPerformance(sqlite3_
     return;
 
   const char *sql = ::sqlite3_sql(aStatement);
 
   // Check to see if this is marked to not warn
   if (::strstr(sql, "/* do not warn (bug "))
     return;
 
-  nsAutoCString message;
+  nsAutoCString message("Suboptimal indexes for the SQL statement ");
+#ifdef MOZ_STORAGE_SORTWARNING_SQL_DUMP
+  message.Append('`');
+  message.Append(sql);
+  message.AppendLiteral("` [");
   message.AppendInt(count);
-  if (count == 1)
-    message.AppendLiteral(" sort operation has ");
-  else
-    message.AppendLiteral(" sort operations have ");
-  message.AppendLiteral("occurred for the SQL statement '");
-#ifdef MOZ_STORAGE_SORTWARNING_SQL_DUMP
-  message.AppendLiteral("SQL command: ");
-  message.Append(sql);
+  message.AppendLiteral(" sort operation(s)]");
 #else
   nsPrintfCString address("0x%p", aStatement);
   message.Append(address);
 #endif
-  message.Append("'.  See https://developer.mozilla.org/En/Storage/Warnings "
-                 "details.");
+  message.AppendLiteral(" (http://mzl.la/1FuID0j).");
   NS_WARNING(message.get());
 }
 
 nsIVariant *
 convertJSValToVariant(
   JSContext *aCtx,
   JS::Value aValue)
 {