summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorTimothy Smith <timothy.smith@sun.com>2008-12-15 13:09:23 -0700
committerTimothy Smith <timothy.smith@sun.com>2008-12-15 13:09:23 -0700
commit45c97126aff027e6179f850cd5d9793af3d9ccc8 (patch)
treeb25c410b383f903a1fa134fd697c0141f6c3cea9 /sql
parent001aaedcb662adb2955fa9cd705ba0906ddea2a5 (diff)
parentaf5cf536bc5246e49a4874a225931a838659cae0 (diff)
downloadmariadb-git-45c97126aff027e6179f850cd5d9793af3d9ccc8.tar.gz
Merge from upstream 5.0-bugteam.
Diffstat (limited to 'sql')
-rw-r--r--sql/item_func.h5
-rw-r--r--sql/log.cc13
2 files changed, 11 insertions, 7 deletions
diff --git a/sql/item_func.h b/sql/item_func.h
index 6dcf32cba07..89c841abb75 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -351,7 +351,10 @@ public:
Item_func_unsigned(Item *a) :Item_func_signed(a) {}
const char *func_name() const { return "cast_as_unsigned"; }
void fix_length_and_dec()
- { max_length=args[0]->max_length; unsigned_flag=1; }
+ {
+ max_length= min(args[0]->max_length, DECIMAL_MAX_PRECISION + 2);
+ unsigned_flag=1;
+ }
longlong val_int();
void print(String *str);
};
diff --git a/sql/log.cc b/sql/log.cc
index 477cb21b2f3..c411f7c8238 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1146,7 +1146,7 @@ int MYSQL_LOG::purge_first_log(struct st_relay_log_info* rli, bool included)
* Need to update the log pos because purge logs has been called
* after fetching initially the log pos at the begining of the method.
*/
- if(error=find_log_pos(&rli->linfo, rli->event_relay_log_name, 0))
+ if((error=find_log_pos(&rli->linfo, rli->event_relay_log_name, 0)))
{
char buff[22];
sql_print_error("next log error: %d offset: %s log: %s included: %d",
@@ -1234,8 +1234,8 @@ int MYSQL_LOG::purge_logs(const char *to_log,
*/
if (!my_b_inited(&purge_temp))
{
- if (error=open_cached_file(&purge_temp, mysql_tmpdir, TEMP_PREFIX,
- DISK_BUFFER_SIZE, MYF(MY_WME)))
+ if ((error=open_cached_file(&purge_temp, mysql_tmpdir, TEMP_PREFIX,
+ DISK_BUFFER_SIZE, MYF(MY_WME))))
{
sql_print_error("MYSQL_LOG::purge_logs failed to open purge_temp");
goto err;
@@ -1243,7 +1243,7 @@ int MYSQL_LOG::purge_logs(const char *to_log,
}
else
{
- if (error=reinit_io_cache(&purge_temp, WRITE_CACHE, 0, 0, 1))
+ if ((error=reinit_io_cache(&purge_temp, WRITE_CACHE, 0, 0, 1)))
{
sql_print_error("MYSQL_LOG::purge_logs failed to reinit purge_temp "
"for write");
@@ -1274,7 +1274,7 @@ int MYSQL_LOG::purge_logs(const char *to_log,
}
/* We know how many files to delete. Update index file. */
- if (error=update_log_index(&log_info, need_update_threads))
+ if ((error=update_log_index(&log_info, need_update_threads)))
{
sql_print_error("MSYQL_LOG::purge_logs failed to update the index file");
goto err;
@@ -1283,7 +1283,7 @@ int MYSQL_LOG::purge_logs(const char *to_log,
DBUG_EXECUTE_IF("crash_after_update_index", abort(););
/* Switch purge_temp for read. */
- if (error=reinit_io_cache(&purge_temp, READ_CACHE, 0, 0, 0))
+ if ((error=reinit_io_cache(&purge_temp, READ_CACHE, 0, 0, 0)))
{
sql_print_error("MSYQL_LOG::purge_logs failed to reinit purge_temp "
"for read");
@@ -1409,6 +1409,7 @@ int MYSQL_LOG::purge_logs(const char *to_log,
}
err:
+ close_cached_file(&purge_temp);
if (need_mutex)
pthread_mutex_unlock(&LOCK_index);
DBUG_RETURN(error);