[dovecot-cvs] dovecot/src/lib-sql driver-mysql.c, 1.21, 1.22 driver-pgsql.c, 1.11, 1.12 driver-sqlite.c, 1.7, 1.8 sql-api-private.h, 1.8, 1.9 sql-api.c, 1.10, 1.11 sql-api.h, 1.9, 1.10

cras at dovecot.org cras at dovecot.org
Sat Jul 1 20:24:15 EEST 2006


Update of /var/lib/cvs/dovecot/src/lib-sql
In directory talvi:/tmp/cvs-serv7742

Modified Files:
	driver-mysql.c driver-pgsql.c driver-sqlite.c 
	sql-api-private.h sql-api.c sql-api.h 
Log Message:
sql_escape_string() should return const char *, not char *.



Index: driver-mysql.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-sql/driver-mysql.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- driver-mysql.c	28 Jun 2006 13:10:46 -0000	1.21
+++ driver-mysql.c	1 Jul 2006 17:24:11 -0000	1.22
@@ -343,7 +343,7 @@
 	return 0;
 }
 
-static char *
+static const char *
 driver_mysql_escape_string(struct sql_db *_db, const char *string)
 {
 	struct mysql_db *db = (struct mysql_db *)_db;

Index: driver-pgsql.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-sql/driver-pgsql.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- driver-pgsql.c	31 May 2006 11:02:50 -0000	1.11
+++ driver-pgsql.c	1 Jul 2006 17:24:11 -0000	1.12
@@ -441,7 +441,8 @@
 	i_error("pgsql: sql_exec() failed: %s", last_error(db));
 }
 
-static char *driver_pgsql_escape_string(struct sql_db *_db, const char *string)
+static const char *
+driver_pgsql_escape_string(struct sql_db *_db, const char *string)
 {
 	struct pgsql_db *db = (struct pgsql_db *)_db;
 	size_t len = strlen(string);

Index: driver-sqlite.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-sql/driver-sqlite.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- driver-sqlite.c	27 Jun 2006 09:25:55 -0000	1.7
+++ driver-sqlite.c	1 Jul 2006 17:24:11 -0000	1.8
@@ -88,8 +88,9 @@
 	return SQL_DB_FLAG_BLOCKING;
 }
 
-static char *driver_sqlite_escape_string(struct sql_db *_db __attr_unused__,
-					 const char *string)
+static const char *
+driver_sqlite_escape_string(struct sql_db *_db __attr_unused__,
+			    const char *string)
 {
 	const char *p;
 	char *dest, *destbegin;

Index: sql-api-private.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-sql/sql-api-private.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- sql-api-private.h	28 Jun 2006 13:10:46 -0000	1.8
+++ sql-api-private.h	1 Jul 2006 17:24:11 -0000	1.9
@@ -12,7 +12,7 @@
 	enum sql_db_flags (*get_flags)(struct sql_db *db);
 
 	int (*connect)(struct sql_db *db);
-	char *(*escape_string)(struct sql_db *db, const char *string);
+	const char *(*escape_string)(struct sql_db *db, const char *string);
 	void (*exec)(struct sql_db *db, const char *query);
 	void (*query)(struct sql_db *db, const char *query,
 		      sql_query_callback_t *callback, void *context);

Index: sql-api.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-sql/sql-api.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- sql-api.c	28 Jun 2006 13:10:46 -0000	1.10
+++ sql-api.c	1 Jul 2006 17:24:11 -0000	1.11
@@ -66,7 +66,7 @@
 	return db->connect(db);
 }
 
-char *sql_escape_string(struct sql_db *db, const char *string)
+const char *sql_escape_string(struct sql_db *db, const char *string)
 {
 	return db->escape_string(db, string);
 }

Index: sql-api.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-sql/sql-api.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- sql-api.h	31 May 2006 11:02:50 -0000	1.9
+++ sql-api.h	1 Jul 2006 17:24:11 -0000	1.10
@@ -38,7 +38,7 @@
 int sql_connect(struct sql_db *db);
 
 /* Escape the given string if needed and return it. */
-char *sql_escape_string(struct sql_db *db, const char *string);
+const char *sql_escape_string(struct sql_db *db, const char *string);
 
 /* Execute SQL query without waiting for results. */
 void sql_exec(struct sql_db *db, const char *query);



More information about the dovecot-cvs mailing list