changeset 21305:398d70068a08

driver-mysql: Do not hex-encode again Use correct syntax to provide data to mysql in hex format, without recoding it in hex format again.
author Aki Tuomi <aki.tuomi@dovecot.fi>
date Wed, 14 Dec 2016 23:20:12 +0200
parents 3095a4ed77e5
children f7a5eb710cad
files src/lib-sql/driver-mysql.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-sql/driver-mysql.c	Tue Dec 13 16:04:53 2016 +0200
+++ b/src/lib-sql/driver-mysql.c	Wed Dec 14 23:20:12 2016 +0200
@@ -651,9 +651,9 @@
 {
 	string_t *str = t_str_new(128);
 
-	str_append(str, "HEX('");
+	str_append(str, "X'");
 	binary_to_hex_append(str, data, size);
-	str_append_c(str, ')');
+	str_append_c(str, '\'');
 	return str_c(str);
 }