]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dict-sql: Change "uint" type to mean 64bit instead of 32bit integer.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 15 Aug 2017 11:27:40 +0000 (14:27 +0300)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Fri, 8 Sep 2017 10:18:32 +0000 (13:18 +0300)
This is likely what is usually wanted (especially in e.g. quotas).
If someone actually wants it to be restricted to 32bit, we could add
uint32 later on.

src/lib-dict/dict-sql.c

index 003464d0e1d50909a9456e63bf7cacb7f565873b..933384b72f4d56de3cae3f05d84c2fe6297ce787 100644 (file)
@@ -219,7 +219,7 @@ sql_dict_value_escape(string_t *str, struct sql_dict *dict,
                      const char **error_r)
 {
        buffer_t *buf;
-       unsigned int num;
+       uint64_t num;
 
        switch (value_type) {
        case DICT_SQL_TYPE_STRING:
@@ -227,13 +227,13 @@ sql_dict_value_escape(string_t *str, struct sql_dict *dict,
                            value_suffix);
                return 0;
        case DICT_SQL_TYPE_UINT:
-               if (value_suffix[0] != '\0' || str_to_uint(value, &num) < 0) {
+               if (value_suffix[0] != '\0' || str_to_uint64(value, &num) < 0) {
                        *error_r = t_strdup_printf(
-                               "%s field's value isn't unsigned integer: %s%s (in pattern: %s)",
+                               "%s field's value isn't 64bit unsigned integer: %s%s (in pattern: %s)",
                                field_name, value, value_suffix, map->pattern);
                        return -1;
                }
-               str_printfa(str, "%u", num);
+               str_printfa(str, "%"PRIu64, num);
                return 0;
        case DICT_SQL_TYPE_HEXBLOB:
                break;