[tracker/functions] libtracker-db: The int of sqlite3_return_error isn't a code, but the length



commit 2b64a139f29b6de240d3b2aa45da73001a1446d9
Author: Philip Van Hoof <philip codeminded be>
Date:   Thu Mar 25 14:02:53 2010 +0100

    libtracker-db: The int of sqlite3_return_error isn't a code, but the length

 src/libtracker-db/tracker-db-interface-sqlite.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-interface-sqlite.c b/src/libtracker-db/tracker-db-interface-sqlite.c
index a110786..86509c3 100644
--- a/src/libtracker-db/tracker-db-interface-sqlite.c
+++ b/src/libtracker-db/tracker-db-interface-sqlite.c
@@ -160,7 +160,7 @@ function_sparql_string_join (sqlite3_context *context,
 	/* fn:string-join (str1, str2, ..., separator) */
 
 	if (sqlite3_value_type (argv[argc-1]) != SQLITE_TEXT) {
-		sqlite3_result_error (context, "Invalid separator", 0);
+		sqlite3_result_error (context, "Invalid separator", -1);
 		return;
 	}
 
@@ -200,7 +200,7 @@ function_sparql_string_from_filename (sqlite3_context *context,
 	gchar  *suffix = NULL;
 
 	if (argc != 1) {
-		sqlite3_result_error (context, "Invalid argument count", 0);
+		sqlite3_result_error (context, "Invalid argument count", -1);
 		return;
 	}
 
@@ -244,7 +244,7 @@ function_sparql_cartesian_distance (sqlite3_context *context,
 	gdouble d;
 
 	if (argc != 4) {
-		sqlite3_result_error (context, "Invalid argument count", 0);
+		sqlite3_result_error (context, "Invalid argument count", -1);
 		return;
 	}
 
@@ -282,7 +282,7 @@ function_sparql_haversine_distance (sqlite3_context *context,
 	gdouble d;
 
 	if (argc != 4) {
-		sqlite3_result_error (context, "Invalid argument count", 0);
+		sqlite3_result_error (context, "Invalid argument count", -1);
 		return;
 	}
 
@@ -314,7 +314,7 @@ function_sparql_regex (sqlite3_context *context,
 	GRegex *regex;
 
 	if (argc != 3) {
-		sqlite3_result_error (context, "Invalid argument count", 0);
+		sqlite3_result_error (context, "Invalid argument count", -1);
 		return;
 	}
 
@@ -346,7 +346,7 @@ function_sparql_regex (sqlite3_context *context,
 				break;
 			default:
 				err_str = g_strdup_printf ("Invalid SPARQL regex flag '%c'", *flags);
-				sqlite3_result_error (context, err_str, 0);
+				sqlite3_result_error (context, err_str, -1);
 				g_free (err_str);
 				return;
 			}
@@ -356,7 +356,7 @@ function_sparql_regex (sqlite3_context *context,
 		regex = g_regex_new (pattern, regex_flags, 0, &error);
 
 		if (error) {
-			sqlite3_result_error (context, error->message, error->code);
+			sqlite3_result_error (context, error->message, -1);
 			g_clear_error (&error);
 			return;
 		}



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