fixed case-sensitive matching

This commit is contained in:
lars 2010-05-24 01:13:40 +00:00
parent 57b6bb4a66
commit 13e95d015f
1 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ test $# -gt 0 && ACTION="$1"
case "$ACTION" in case "$ACTION" in
get) get)
# get distinct names and ignore empty lines # get distinct names and ignore empty lines
echo "SELECT DISTINCT name FROM channel ORDER BY LPAD(channum, 3, 0) BINARY;" \ echo "SELECT DISTINCT BINARY name FROM channel ORDER BY LPAD(channum, 3, 0) ASC;" \
| send_mysql_statement \ | send_mysql_statement \
| grep -v "^$" | grep -v "^$"
;; ;;
@ -104,7 +104,7 @@ case "$ACTION" in
cat - | grep -v "^$" | while read channel; do cat - | grep -v "^$" | while read channel; do
# escape single quotes # escape single quotes
channel=$(echo "$channel" | sed "s/'/\\\\'/g") channel=$(echo "$channel" | sed "s/'/\\\\'/g")
echo "update channel set channum=$current_num where name='$channel' BINARY;" echo "update channel set channum=$current_num where BINARY name='$channel';"
current_num=$((current_num + 1)) current_num=$((current_num + 1))
done done
) | send_mysql_statement ) | send_mysql_statement