traiter les valeurs \N

This commit is contained in:
Jephté Clain 2015-03-06 09:54:33 +04:00
parent 69548d0d76
commit 17193cc65d
1 changed files with 3 additions and 1 deletions

View File

@ -86,7 +86,9 @@ OPTIONS
__AWK_MYSQLFUNCS=' __AWK_MYSQLFUNCS='
function format_sqlvalue(value) { function format_sqlvalue(value) {
if (value ~ /^[0-9]+$/) { if (value == "\\N") {
value = "NULL"
} else if (value ~ /^[0-9]+$/) {
} else if (value ~ /^[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9]$/) { } else if (value ~ /^[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9]$/) {
value = "str_to_date('\''" value "'\'', '\''%d/%m/%y'\'')" value = "str_to_date('\''" value "'\'', '\''%d/%m/%y'\'')"
} else if (value ~ /^[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9][0-9][0-9]$/) { } else if (value ~ /^[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9][0-9][0-9]$/) {