Below is the list of changes that have just been committed into a local
5.1 repository of davi. When davi does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2008-05-02 15:10:32-03:00, davi@stripped +1 -0
Bug#36031 Test funcs_1.<engine>_views failing on Windows
The problem is a hack in mysqltest.c::append_field that modifies
the exponential notation of floating point numbers by removing a
zero after the the symbol 'e' (eg: 00001.2e+018 is converted to
00001.2e+18) but does not take into account the zerofill affect
in the start of the string.
The solution is to check if the field was zero filled and insert
a zero at the start of the string if a zero after the exponential
notation symbol is removed.
client/mysqltest.c@stripped, 2008-05-02 15:10:30-03:00, davi@stripped +15 -6
Preserve zerofill affect when removing a zero after
the exponential notation symbol.
diff -Nrup a/client/mysqltest.c b/client/mysqltest.c
--- a/client/mysqltest.c 2008-05-01 12:58:37 -03:00
+++ b/client/mysqltest.c 2008-05-02 15:10:30 -03:00
@@ -5595,7 +5595,7 @@ void fix_win_paths(const char *val, int
*/
void append_field(DYNAMIC_STRING *ds, uint col_idx, MYSQL_FIELD* field,
- const char* val, ulonglong len, my_bool is_null)
+ char* val, ulonglong len, my_bool is_null)
{
if (col_idx < max_replace_column && replace_column[col_idx])
{
@@ -5618,9 +5618,18 @@ void append_field(DYNAMIC_STRING *ds, ui
(start[1] == '-' || start[1] == '+') && start[2] == '0')
{
start+=2; /* Now points at first '0' */
- /* Move all chars after the first '0' one step left */
- memmove(start, start + 1, strlen(start));
- len--;
+ if (field->flags & ZEROFILL_FLAG)
+ {
+ /* Move all chars before the first '0' one step right */
+ memmove(val + 1, val, start - val);
+ *val= '0';
+ }
+ else
+ {
+ /* Move all chars after the first '0' one step left */
+ memmove(start, start + 1, strlen(start));
+ len--;
+ }
}
}
#endif
@@ -5659,7 +5668,7 @@ void append_result(DYNAMIC_STRING *ds, M
lengths = mysql_fetch_lengths(res);
for (i = 0; i < num_fields; i++)
append_field(ds, i, &fields[i],
- (const char*)row[i], lengths[i], !row[i]);
+ row[i], lengths[i], !row[i]);
if (!display_result_vertically)
dynstr_append_mem(ds, "\n", 1);
}
@@ -5708,7 +5717,7 @@ void append_stmt_result(DYNAMIC_STRING *
while (mysql_stmt_fetch(stmt) == 0)
{
for (i= 0; i < num_fields; i++)
- append_field(ds, i, &fields[i], (const char *) my_bind[i].buffer,
+ append_field(ds, i, &fields[i], my_bind[i].buffer,
*my_bind[i].length, *my_bind[i].is_null);
if (!display_result_vertically)
dynstr_append_mem(ds, "\n", 1);
| Thread |
|---|
| • bk commit into 5.1 tree (davi:1.2603) BUG#36031 | Davi Arnaut | 2 May |