mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-03-10 00:20:54 +08:00
Let LC_COLLATE influence string-comparison operations
By default this will be set to the C locale, but set it to the user's locale when string comparisons are performed from mdb-sql. Note that this can be overridden with the LC_COLLATE environment variable. We could infer the collation locale from the file itself, but this will likely require a big ball of glue between the Windows locales and Unix ones.
This commit is contained in:
@@ -426,7 +426,7 @@ mdb_sql_eval_expr(MdbSQL *sql, char *const1, int op, char *const2)
|
||||
MdbSargNode *node;
|
||||
|
||||
if (const1[0]=='\'' && const2[0]=='\'') {
|
||||
value = strcmp(const1, const2);
|
||||
value = strcoll(const1, const2);
|
||||
switch (op) {
|
||||
case MDB_EQUAL: compar = (value ? 0 : 1); break;
|
||||
case MDB_GT: compar = (value > 0); break;
|
||||
@@ -984,4 +984,4 @@ mdb_sql_dump_results(MdbSQL *sql)
|
||||
/* the column and table names are no good now */
|
||||
mdb_sql_reset(sql);
|
||||
}
|
||||
/** @}*/
|
||||
/** @}*/
|
||||
|
||||
Reference in New Issue
Block a user