Code

t/utils/dbi_test: Added missing cases in dbi_result_get_field_length_idx().
authorSebastian Harl <sh@tokkee.org>
Tue, 3 Sep 2013 09:05:38 +0000 (11:05 +0200)
committerSebastian Harl <sh@tokkee.org>
Tue, 3 Sep 2013 09:05:38 +0000 (11:05 +0200)
t/utils/dbi_test.c

index f6a860cf061c5a43461d6f8dd6eecd0ca04bc846..1666d6ed7e92af8e0baaa63b29b4ce9f8d0d26bc 100644 (file)
@@ -304,12 +304,16 @@ dbi_result_get_field_length_idx(dbi_result res, unsigned int i)
 
        switch (current_query->field_types[i]) {
                case DBI_TYPE_INTEGER:
+                       return sizeof(long long);
                        break;
                case DBI_TYPE_DECIMAL:
+                       return sizeof(double);
                        break;
                case DBI_TYPE_STRING:
+                       return strlen(get_golden_data(res, i).string) + 1;
                        break;
                case DBI_TYPE_DATETIME:
+                       return sizeof(time_t);
                        break;
                case DBI_TYPE_BINARY:
                        return get_golden_data(res, i).binary.length;