monotone-commits-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-commits-diffs] org.debian.monotone: 7f0976f5c960c9f494b1de0b27


From: code
Subject: [Monotone-commits-diffs] org.debian.monotone: 7f0976f5c960c9f494b1de0b27307dc7759986ca
Date: Mon, 11 Mar 2013 21:54:14 +0100 (CET)

revision:            7f0976f5c960c9f494b1de0b27307dc7759986ca
date:                2010-10-26T16:16:15
author:              Francis Russell <address@hidden>
branch:              org.debian.monotone
changelog:
Backport upstream fix for change in SQLite empty blob behaviour.

manifest:
format_version "1"

new_manifest [b6e0440e62c9edfb8941eebd5352a224d8058ef2]

old_revision [df915f28293deaa99475ad982dfb2e0f1996a834]

add_file "patches/10-sqlite_3.7.3_empty_blob.diff"
 content [69ffd220f2ed68b00fe2b06bd93402b76cf01903]

patch "changelog"
 from [cfb890c224915aa503d43930a68ce1cb2455051a]
   to [27c7ec19639f84113098dd5578cc949cc8605cac]

patch "patches/series"
 from [8bec750bce1e1dc66bb0b390532a900f9ba11e8f]
   to [010e54b02a946755c6c68e9a6e9fe9d1c0605648]
============================================================
--- changelog	cfb890c224915aa503d43930a68ce1cb2455051a
+++ changelog	27c7ec19639f84113098dd5578cc949cc8605cac
@@ -3,8 +3,9 @@ monotone (0.48.1-1) UNRELEASED; urgency=
   * New upstream release.
     - Contains security fix to prevent crashing of servers with remote command
       execution enabled.
+  * Backport upstream fix for change in SQLite empty blob behaviour.
 
- -- Francis Russell <address@hidden>  Tue, 26 Oct 2010 16:42:37 +0100
+ -- Francis Russell <address@hidden>  Tue, 26 Oct 2010 17:11:42 +0100
 
 monotone (0.48-3) UNRELEASED; urgency=low
 
============================================================
--- /dev/null	
+++ patches/10-sqlite_3.7.3_empty_blob.diff	69ffd220f2ed68b00fe2b06bd93402b76cf01903
@@ -0,0 +1,34 @@
+From upstream changelog for revision 97939c9677047b36beef031cce4c1896849a987c:
+  sqlite3_column_blob() returns null for both empty blobs and real nulls.
+  Check the actual datatype first, and don't rely on a non-null return.
+  This only matters for recent SQLite, noted in bug 96.
+
+See also http://code.monotone.ca/p/monotone/issues/96/.
+Index: monotone-0.48.1/database.cc
+===================================================================
+--- monotone-0.48.1.orig/database.cc	2010-10-26 17:09:59.401570755 +0100
++++ monotone-0.48.1/database.cc	2010-10-26 17:10:14.563939979 +0100
+@@ -1489,12 +1489,19 @@
+       vector<string> row;
+       for (int col = 0; col < ncol; col++)
+         {
++          // We never store NULLs, so we should never see one.
++          int const datatype = sqlite3_column_type(i->second.stmt(), col);
++          E(datatype != SQLITE_NULL, origin::database,
++            F("null result in query: %s") % query.sql_cmd);
+           const char * value = (const char*)sqlite3_column_blob(i->second.stmt(), col);
+           int bytes = sqlite3_column_bytes(i->second.stmt(), col);
+-          E(value, origin::database,
+-            F("null result in query: %s") % query.sql_cmd);
+-          row.push_back(string(value, value + bytes));
+-          //L(FL("row %d col %d value='%s'") % nrow % col % value);
++          if (value) {
++            row.push_back(string(value, value + bytes));
++          } else {
++            // sqlite3_column_blob() returns null for zero-length
++            I(bytes == 0);
++            row.push_back(string());
++          }
+         }
+       res.push_back(row);
+     }
============================================================
--- patches/series	8bec750bce1e1dc66bb0b390532a900f9ba11e8f
+++ patches/series	010e54b02a946755c6c68e9a6e9fe9d1c0605648
@@ -1,2 +1,3 @@ 00-fail_cleanly_on_unreadable_db.diff
 00-fail_cleanly_on_unreadable_db.diff
+10-sqlite_3.7.3_empty_blob.diff
 90-stacktrace-on-crash.diff

reply via email to

[Prev in Thread] Current Thread [Next in Thread]