summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/item_windowfunc.h2
-rw-r--r--sql/log.cc4
-rw-r--r--sql/mdl.cc2
-rw-r--r--sql/rpl_gtid.cc4
-rw-r--r--sql/sql_cte.h2
-rw-r--r--sql/sql_test.cc2
-rw-r--r--sql/sql_time.cc2
-rw-r--r--sql/sql_window.cc56
8 files changed, 37 insertions, 37 deletions
diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h
index 40f48cc7dc5..3674a45b5ca 100644
--- a/sql/item_windowfunc.h
+++ b/sql/item_windowfunc.h
@@ -433,7 +433,7 @@ class Item_sum_ntile : public Item_sum_window_with_row_count
double val_real()
{
- return val_int();
+ return (double) val_int();
}
longlong val_int()
diff --git a/sql/log.cc b/sql/log.cc
index d230b1ceb0d..39f001af554 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1681,13 +1681,13 @@ static int binlog_close_connection(handlerton *hton, THD *thd)
size_t len=0;
wsrep_write_cache_buf(cache, &buf, &len);
WSREP_WARN("binlog trx cache not empty (%lu bytes) @ connection close %lld",
- len, (longlong) thd->thread_id);
+ (ulong) len, (longlong) thd->thread_id);
if (len > 0) wsrep_dump_rbr_buf(thd, buf, len);
cache = cache_mngr->get_binlog_cache_log(false);
wsrep_write_cache_buf(cache, &buf, &len);
WSREP_WARN("binlog stmt cache not empty (%lu bytes) @ connection close %lld",
- len, (longlong) thd->thread_id);
+ (ulong) len, (longlong) thd->thread_id);
if (len > 0) wsrep_dump_rbr_buf(thd, buf, len);
}
#endif /* WITH_WSREP */
diff --git a/sql/mdl.cc b/sql/mdl.cc
index 61591ec9f57..cb616c30b1e 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -669,7 +669,7 @@ int mdl_iterate(int (*callback)(MDL_ticket *ticket, void *arg), void *arg)
my_hash_value_type mdl_hash_function(CHARSET_INFO *cs,
const uchar *key, size_t length)
{
- MDL_key *mdl_key= (MDL_key*) (key - offsetof(MDL_key, m_ptr));
+ MDL_key *mdl_key= (MDL_key*) (key - my_offsetof(MDL_key, m_ptr));
return mdl_key->hash_value();
}
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc
index 5a94e1c5b54..4adea76b3cb 100644
--- a/sql/rpl_gtid.cc
+++ b/sql/rpl_gtid.cc
@@ -1015,8 +1015,8 @@ gtid_parser_helper(char **ptr, char *end, rpl_gtid *out_gtid)
if (err != 0)
return 1;
- out_gtid->domain_id= v1;
- out_gtid->server_id= v2;
+ out_gtid->domain_id= (uint32) v1;
+ out_gtid->server_id= (uint32) v2;
out_gtid->seq_no= v3;
*ptr= q;
return 0;
diff --git a/sql/sql_cte.h b/sql/sql_cte.h
index 0cbc9247af9..761d01ccd7f 100644
--- a/sql/sql_cte.h
+++ b/sql/sql_cte.h
@@ -41,7 +41,7 @@ private:
LEX_STRING unparsed_spec;
/* Return the map where 1 is set only in the position for this element */
- table_map get_elem_map() { return 1 << number; }
+ table_map get_elem_map() { return (table_map) 1 << number; }
public:
/*
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index 76586a9fbba..8177a0baa53 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -559,7 +559,6 @@ C_MODE_END
void mysql_print_status()
{
char current_dir[FN_REFLEN];
- char llbuff[10][22];
STATUS_VAR tmp;
uint count;
@@ -616,6 +615,7 @@ Next alarm time: %lu\n",
display_table_locks();
#ifdef HAVE_MALLINFO
struct mallinfo info= mallinfo();
+ char llbuff[10][22];
printf("\nMemory status:\n\
Non-mmapped space allocated from system: %s\n\
Number of free chunks: %lu\n\
diff --git a/sql/sql_time.cc b/sql/sql_time.cc
index eddf14bfbf3..5ef036965b8 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -427,7 +427,7 @@ bool decimal_to_datetime_with_warn(const my_decimal *value, MYSQL_TIME *ltime,
bool int_to_datetime_with_warn(bool neg, ulonglong value, MYSQL_TIME *ltime,
ulonglong fuzzydate, const char *field_name)
{
- const ErrConvInteger str(neg ? -value : value, !neg);
+ const ErrConvInteger str(neg ? - (longlong) value : (longlong) value, !neg);
return number_to_time_with_warn(neg, value, 0, ltime,
fuzzydate, &str, field_name);
}
diff --git a/sql/sql_window.cc b/sql/sql_window.cc
index e3e42fc4f75..4c5ef53d854 100644
--- a/sql/sql_window.cc
+++ b/sql/sql_window.cc
@@ -696,7 +696,7 @@ public:
- in table->record[0]..
- rownum parameter has the row number.
*/
- void on_next_partition(int rownum)
+ void on_next_partition(ha_rows rownum)
{
/* Remember the sort key value from the new partition */
bound_tracker.check_if_next_group();
@@ -706,7 +706,7 @@ public:
/*
Moves to a new row. The row is assumed to be within the current partition
*/
- void move_to(int rownum) { tbl_cursor.move_to(rownum); }
+ void move_to(ha_rows rownum) { tbl_cursor.move_to(rownum); }
/*
This returns -1 when end of partition was reached.
@@ -796,8 +796,8 @@ public:
- The callee may move tbl->file and tbl->record[0] to point to some other
row.
*/
- virtual void pre_next_partition(longlong rownum, Item_sum* item){};
- virtual void next_partition(longlong rownum, Item_sum* item)=0;
+ virtual void pre_next_partition(ha_rows rownum, Item_sum* item){};
+ virtual void next_partition(ha_rows rownum, Item_sum* item)=0;
/*
The current row has moved one row forward.
@@ -872,13 +872,13 @@ public:
item_add->fix_fields(thd, &item_add);
}
- void pre_next_partition(longlong rownum, Item_sum* item)
+ void pre_next_partition(ha_rows rownum, Item_sum* item)
{
// Save the value of FUNC(current_row)
range_expr->fetch_value_from(item_add);
}
- void next_partition(longlong rownum, Item_sum* item)
+ void next_partition(ha_rows rownum, Item_sum* item)
{
cursor.move_to(rownum);
walk_till_non_peer(item);
@@ -982,7 +982,7 @@ public:
item_add->fix_fields(thd, &item_add);
}
- void pre_next_partition(longlong rownum, Item_sum* item)
+ void pre_next_partition(ha_rows rownum, Item_sum* item)
{
// Save the value of FUNC(current_row)
range_expr->fetch_value_from(item_add);
@@ -991,7 +991,7 @@ public:
end_of_partition= false;
}
- void next_partition(longlong rownum, Item_sum* item)
+ void next_partition(ha_rows rownum, Item_sum* item)
{
cursor.move_to(rownum);
walk_till_non_peer(item);
@@ -1068,7 +1068,7 @@ public:
peer_tracker.init(thd, order_list);
}
- void pre_next_partition(longlong rownum, Item_sum* item)
+ void pre_next_partition(ha_rows rownum, Item_sum* item)
{
// Save the value of the current_row
peer_tracker.check_if_next_group();
@@ -1080,7 +1080,7 @@ public:
}
}
- void next_partition(longlong rownum, Item_sum* item)
+ void next_partition(ha_rows rownum, Item_sum* item)
{
walk_till_non_peer(item);
}
@@ -1158,14 +1158,14 @@ public:
peer_tracker.init(thd, order_list);
}
- void pre_next_partition(longlong rownum, Item_sum* item)
+ void pre_next_partition(ha_rows rownum, Item_sum* item)
{
// Fetch the value from the first row
peer_tracker.check_if_next_group();
cursor.move_to(rownum+1);
}
- void next_partition(longlong rownum, Item_sum* item) {}
+ void next_partition(ha_rows rownum, Item_sum* item) {}
void pre_next_row(Item_sum* item)
{
@@ -1214,7 +1214,7 @@ public:
class Frame_unbounded_preceding : public Frame_cursor
{
public:
- void next_partition(longlong rownum, Item_sum* item)
+ void next_partition(ha_rows rownum, Item_sum* item)
{
/*
UNBOUNDED PRECEDING frame end just stays on the first row.
@@ -1245,12 +1245,12 @@ public:
cursor.init(thd, info, partition_list);
}
- void pre_next_partition(longlong rownum, Item_sum* item)
+ void pre_next_partition(ha_rows rownum, Item_sum* item)
{
cursor.on_next_partition(rownum);
}
- void next_partition(longlong rownum, Item_sum* item)
+ void next_partition(ha_rows rownum, Item_sum* item)
{
if (!rownum)
{
@@ -1279,9 +1279,9 @@ class Frame_unbounded_following_set_count : public Frame_unbounded_following
public:
// pre_next_partition is inherited
- void next_partition(longlong rownum, Item_sum* item)
+ void next_partition(ha_rows rownum, Item_sum* item)
{
- ulonglong num_rows_in_partition= 0;
+ ha_rows num_rows_in_partition= 0;
if (!rownum)
{
/* Read the first row */
@@ -1330,7 +1330,7 @@ public:
cursor.init(info);
}
- void next_partition(longlong rownum, Item_sum* item)
+ void next_partition(ha_rows rownum, Item_sum* item)
{
/*
Position our cursor to point at the first row in the new partition
@@ -1391,11 +1391,11 @@ public:
class Frame_rows_current_row_bottom : public Frame_cursor
{
public:
- void pre_next_partition(longlong rownum, Item_sum* item)
+ void pre_next_partition(ha_rows rownum, Item_sum* item)
{
item->add();
}
- void next_partition(longlong rownum, Item_sum* item) {}
+ void next_partition(ha_rows rownum, Item_sum* item) {}
void pre_next_row(Item_sum* item)
{
/* Temp table's current row is current_row. Add it to the window func */
@@ -1456,7 +1456,7 @@ public:
at_partition_end= false;
}
- void pre_next_partition(longlong rownum, Item_sum* item)
+ void pre_next_partition(ha_rows rownum, Item_sum* item)
{
at_partition_end= false;
@@ -1476,10 +1476,10 @@ public:
}
/* Move our cursor to be n_rows ahead. */
- void next_partition(longlong rownum, Item_sum* item)
+ void next_partition(ha_rows rownum, Item_sum* item)
{
- longlong i_end= n_rows + ((rownum==0)?1:0)- is_top_bound;
- for (longlong i= 0; i < i_end; i++)
+ ha_rows i_end= n_rows + ((rownum==0)?1:0)- is_top_bound;
+ for (ha_rows i= 0; i < i_end; i++)
{
if (next_row_intern(item))
break;
@@ -1561,10 +1561,10 @@ Frame_cursor *get_frame_cursor(Window_frame *frame, bool is_top_bound)
if (frame->units == Window_frame::UNITS_ROWS)
{
- longlong n_rows= bound->offset->val_int();
+ ha_rows n_rows= bound->offset->val_int();
/* These should be handled in the parser */
DBUG_ASSERT(!bound->offset->null_value);
- DBUG_ASSERT(n_rows >= 0);
+ DBUG_ASSERT((longlong) n_rows >= 0);
if (is_preceding)
return new Frame_n_rows_preceding(is_top_bound, n_rows);
else
@@ -1676,7 +1676,7 @@ void get_window_func_required_cursors(
bool compute_window_func_with_frames(Item_window_func *item_win,
TABLE *tbl, READ_RECORD *info)
{
- THD *thd= current_thd;
+ THD *thd= tbl->in_use;
int err= 0;
Item_sum *sum_func= item_win->window_func();
@@ -1695,7 +1695,7 @@ bool compute_window_func_with_frames(Item_window_func *item_win,
}
bool is_error= false;
- longlong rownum= 0;
+ ha_rows rownum= 0;
uchar *rowid_buf= (uchar*) my_malloc(tbl->file->ref_length, MYF(0));
while (true)