diff options
Diffstat (limited to 'client/mysqlimport.c')
-rw-r--r-- | client/mysqlimport.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 4ca6edf21f2..3672edd62e5 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -452,18 +452,21 @@ static void db_error(MYSQL *mysql) } -static char *add_load_option(char *ptr,const char *object,const char *statement) +static char *add_load_option(char *ptr, const char *object, + const char *statement) { if (object) { - if (!strncasecmp(object,"0x",2)) /* hex constant; don't escape */ - ptr= strxmov(ptr," ",statement," ",object,NullS); - else /* char constant; escape */ - { - ptr= strxmov(ptr," ",statement," '",NullS); - ptr= field_escape(ptr,object,(uint) strlen(object)); - *ptr++= '\''; - } + /* Don't escape hex constants */ + if (object[0] == '0' && (object[1] == 'x' || object[1] == 'X')) + ptr= strxmov(ptr," ",statement," ",object,NullS); + else + { + /* char constant; escape */ + ptr= strxmov(ptr," ",statement," '",NullS); + ptr= field_escape(ptr,object,(uint) strlen(object)); + *ptr++= '\''; + } } return ptr; } |