mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Fixes for binary protocol (complement to last push)
Changed timestamp to return string in YYYY-MM-DD HH:MM:SS format. DATE_ADD() and related functions now returns correct DATE/DATETIME type depending on argument types. Now all tests passes, still some work left to remove warnings in log files from mysql-test-run
This commit is contained in:
@@ -310,30 +310,7 @@ void field_str::add()
|
||||
was_maybe_zerofill = num_info.maybe_zerofill;
|
||||
}
|
||||
|
||||
if (room_in_tree)
|
||||
{
|
||||
if (res != &s)
|
||||
s.copy(*res);
|
||||
if (!tree_search(&tree, (void*) &s, tree.custom_arg)) // If not in tree
|
||||
{
|
||||
s.copy(); // slow, when SAFE_MALLOC is in use
|
||||
if (!tree_insert(&tree, (void*) &s, 0, tree.custom_arg))
|
||||
{
|
||||
room_in_tree = 0; // Remove tree, out of RAM ?
|
||||
delete_tree(&tree);
|
||||
}
|
||||
else
|
||||
{
|
||||
bzero((char*) &s, sizeof(s)); // Let tree handle free of this
|
||||
if ((treemem += length) > pc->max_treemem)
|
||||
{
|
||||
room_in_tree = 0; // Remove tree, too big tree
|
||||
delete_tree(&tree);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Update min and max arguments */
|
||||
if (!found)
|
||||
{
|
||||
found = 1;
|
||||
@@ -364,6 +341,31 @@ void field_str::add()
|
||||
max_arg.copy(*res);
|
||||
}
|
||||
}
|
||||
|
||||
if (room_in_tree)
|
||||
{
|
||||
if (res != &s)
|
||||
s.copy(*res);
|
||||
if (!tree_search(&tree, (void*) &s, tree.custom_arg)) // If not in tree
|
||||
{
|
||||
s.copy(); // slow, when SAFE_MALLOC is in use
|
||||
if (!tree_insert(&tree, (void*) &s, 0, tree.custom_arg))
|
||||
{
|
||||
room_in_tree = 0; // Remove tree, out of RAM ?
|
||||
delete_tree(&tree);
|
||||
}
|
||||
else
|
||||
{
|
||||
bzero((char*) &s, sizeof(s)); // Let tree handle free of this
|
||||
if ((treemem += length) > pc->max_treemem)
|
||||
{
|
||||
room_in_tree = 0; // Remove tree, too big tree
|
||||
delete_tree(&tree);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((num_info.zerofill && (max_length != min_length)) ||
|
||||
(was_zero_fill && (max_length != min_length)))
|
||||
can_be_still_num = 0; // zerofilled numbers must be of same length
|
||||
|
||||
Reference in New Issue
Block a user