From 6d5424a8b45f7c739736e738a891fd65017207e0 Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Mon, 4 Mar 2013 13:37:19 +0100 Subject: [PATCH] fix SQL quoting --- atom | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/atom b/atom index f932d75..6481b3a 100755 --- a/atom +++ b/atom @@ -299,7 +299,7 @@ Select() { while read key operator value do (( ${#where_statement} )) && where_statement+=( "AND" ) - where_statement+=( "$key $operator "'"'"${value//\"/\\\"}"'"' ) + where_statement+=( "$key $operator "'"'"${value//\"/\"\"}"'"' ) done echo "SELECT IFNULL(" \ "(SELECT $columns FROM $table" \ @@ -333,7 +333,7 @@ Insert() { then insert_values+="NULL" else - insert_values+='"'"${value//\"/\\\"}"'"' + insert_values+='"'"${value//\"/\"\"}"'"' fi done echo "INSERT INTO $table" \ @@ -372,7 +372,7 @@ Update(){ what=value ;; value) - set_statement="${set_statement}="'"'"${argument//\"/\\\"}"'"' + set_statement="${set_statement}="'"'"${argument//\"/\"\"}"'"' what=key ;; esac @@ -384,7 +384,7 @@ Update(){ then where_statement+=( "$key is NULL" ) else - where_statement+=( "$key $operator "'"'"${value//\"/\\\"}"'"' ) + where_statement+=( "$key $operator "'"'"${value//\"/\"\"}"'"' ) fi done echo "UPDATE '$table' SET" \ @@ -519,7 +519,7 @@ Delete() { then where_statement+=( "$key is NULL" ) else - where_statement+=( "$key $operator "'"'"${value//\"/\\\"}"'"' ) + where_statement+=( "$key $operator "'"'"${value//\"/\"\"}"'"' ) fi done echo "DELETE from $table WHERE ${where_statement[@]};" >&3