summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2012-08-14 19:59:28 +0300
committerMichael Widenius <monty@askmonty.org>2012-08-14 19:59:28 +0300
commitb886cac7123bc37d055fecd49d9a30ce0c39da73 (patch)
treec20877daef97377e843fd3c821a58b6c90f08174
parentc0f04fa31cd46c2507b2152eeeeb4950e0d5edc9 (diff)
downloadmariadb-git-b886cac7123bc37d055fecd49d9a30ce0c39da73.tar.gz
Fixed compiler errors
Updated test to also work on 32 bit mysql-test/suite/heap/heap.test: Updated test to also work on 32 bit
-rw-r--r--mysql-test/suite/heap/heap.test8
-rw-r--r--sql/create_options.cc5
-rw-r--r--sql/ha_partition.cc2
-rw-r--r--sql/item_subselect.cc21
-rw-r--r--sql/multi_range_read.cc2
-rw-r--r--sql/sql_parse.cc2
-rw-r--r--sql/sql_select.cc3
-rw-r--r--storage/innobase/log/log0recv.c2
-rw-r--r--storage/maria/ha_maria.cc2
-rw-r--r--storage/maria/ma_blockrec.c2
-rw-r--r--storage/maria/ma_ft_nlq_search.c2
-rw-r--r--storage/maria/ma_key_recover.c7
-rw-r--r--storage/maria/ma_pagecache.c1
-rw-r--r--storage/maria/ma_search.c4
-rw-r--r--storage/myisam/ft_nlq_search.c1
-rw-r--r--storage/xtradb/handler/ha_innodb.cc12
-rw-r--r--storage/xtradb/log/log0recv.c2
-rw-r--r--strings/ctype-ucs2.c9
18 files changed, 64 insertions, 23 deletions
diff --git a/mysql-test/suite/heap/heap.test b/mysql-test/suite/heap/heap.test
index 681d3b422e7..6f5046af139 100644
--- a/mysql-test/suite/heap/heap.test
+++ b/mysql-test/suite/heap/heap.test
@@ -494,18 +494,22 @@ DROP TABLE t1;
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=100;
insert into t1 values(1);
+--replace_result 800 1600 1200 2400
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
drop table t1;
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=10000;
insert into t1 values(1);
+--replace_result 8000 16000 12000 24000
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
drop table t1;
CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=3000 max_rows=3000;
insert into t1 values(1);
+--replace_result 24000 48000 36000 72000
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
drop table t1;
CREATE TABLE t1 (a int, index(a)) engine=heap max_rows=15000;
insert into t1 values(1);
+--replace_result 12000 24000 18000 36000
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
drop table t1;
@@ -521,11 +525,15 @@ insert into t1 select rand(100000000) from t1;
insert into t1 select rand(100000000) from t1;
insert into t1 select rand(100000000) from t1;
insert into t1 select rand(100000000) from t1 limit 488;
+--replace_result 8000 16000 12000 24000
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
insert into t1 select rand(100000000) from t1 limit 1;
+--replace_result 16512 33024 24512 49024
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
insert into t1 select rand(100000000) from t1 limit 1000;
+--replace_result 24512 49024 36512 73024
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
insert into t1 select rand(100000000) from t1;
+--replace_result 40512 81024 60512 121024
select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1";
drop table t1;
diff --git a/sql/create_options.cc b/sql/create_options.cc
index 9a6f6b5cf7c..e4881388688 100644
--- a/sql/create_options.cc
+++ b/sql/create_options.cc
@@ -137,7 +137,10 @@ static bool set_one_value(ha_create_table_option *opt,
my_option optp=
{ opt->name, 1, 0, (uchar **)val, 0, 0, GET_ULL,
- REQUIRED_ARG, opt->def_value, opt->min_value, opt->max_value,
+ REQUIRED_ARG,
+ (longlong) opt->def_value,
+ (longlong) opt->min_value,
+ opt->max_value,
0, (long) opt->block_size, 0};
ulonglong orig_val= strtoull(value->str, NULL, 10);
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 0d2b4387327..b3f97d35033 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -3837,7 +3837,7 @@ int ha_partition::truncate_partition(Alter_info *alter_info, bool *binlog_stmt)
{
List_iterator<partition_element>
subpart_it(part_elem->subpartitions);
- partition_element *sub_elem;
+ partition_element *sub_elem __attribute__((unused));
uint j= 0, part;
do
{
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 49d232d31be..8b9904ea260 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -5167,10 +5167,16 @@ Ordered_key::cmp_keys_by_row_data(ha_rows a, ha_rows b)
rowid_a= row_num_to_rowid + a * rowid_length;
rowid_b= row_num_to_rowid + b * rowid_length;
/* Fetch the rows for comparison. */
- error= tbl->file->ha_rnd_pos(tbl->record[0], rowid_a);
- DBUG_ASSERT(!error);
- error= tbl->file->ha_rnd_pos(tbl->record[1], rowid_b);
- DBUG_ASSERT(!error);
+ if ((error= tbl->file->ha_rnd_pos(tbl->record[0], rowid_a)))
+ {
+ tbl->file->print_error(error, MYF(ME_FATALERROR)); // Sets fatal_error
+ return 0;
+ }
+ if ((error= tbl->file->ha_rnd_pos(tbl->record[1], rowid_b)))
+ {
+ tbl->file->print_error(error, MYF(ME_FATALERROR)); // Sets fatal_error
+ return 0;
+ }
/*
Compare the two rows by the corresponding values of the indexed
columns.
@@ -5245,8 +5251,11 @@ int Ordered_key::cmp_key_with_search_key(rownum_t row_num)
uchar *cur_rowid= row_num_to_rowid + row_num * rowid_length;
int error, cmp_res;
- error= tbl->file->ha_rnd_pos(tbl->record[0], cur_rowid);
- DBUG_ASSERT(!error);
+ if ((error= tbl->file->ha_rnd_pos(tbl->record[0], cur_rowid)))
+ {
+ tbl->file->print_error(error, MYF(ME_FATALERROR)); // Sets fatal_error
+ return 0;
+ }
for (uint i= 0; i < key_column_count; i++)
{
diff --git a/sql/multi_range_read.cc b/sql/multi_range_read.cc
index 7268491c0f4..800602fe9e1 100644
--- a/sql/multi_range_read.cc
+++ b/sql/multi_range_read.cc
@@ -1404,7 +1404,7 @@ ha_rows DsMrr_impl::dsmrr_info(uint keyno, uint n_ranges, uint rows,
uint key_parts,
uint *bufsz, uint *flags, COST_VECT *cost)
{
- ha_rows res;
+ ha_rows res __attribute__((unused));
uint def_flags= *flags;
uint def_bufsz= *bufsz;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 49014db9505..6f157c89ee2 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1325,7 +1325,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
{
STATUS_VAR *current_global_status_var; // Big; Don't allocate on stack
ulong uptime;
- uint length;
+ uint length __attribute__((unused));
ulonglong queries_per_second1000;
char buff[250];
uint buff_len= sizeof(buff);
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index da43b4b5e30..165e257d42d 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -6408,7 +6408,8 @@ greedy_search(JOIN *join,
uint size_remain; // cardinality of remaining_tables
POSITION best_pos;
JOIN_TAB *best_table; // the next plan node to be added to the curr QEP
- uint n_tables; // ==join->tables or # tables in the sj-mat nest we're optimizing
+ // ==join->tables or # tables in the sj-mat nest we're optimizing
+ uint n_tables __attribute__((unused));
DBUG_ENTER("greedy_search");
diff --git a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c
index f9e0fecb6c6..6c55a1badc5 100644
--- a/storage/innobase/log/log0recv.c
+++ b/storage/innobase/log/log0recv.c
@@ -2900,7 +2900,7 @@ recv_recovery_from_checkpoint_start_func(
ib_uint64_t checkpoint_lsn;
ib_uint64_t checkpoint_no;
ib_uint64_t old_scanned_lsn;
- ib_uint64_t group_scanned_lsn;
+ ib_uint64_t group_scanned_lsn= 0;
ib_uint64_t contiguous_lsn;
#ifdef UNIV_LOG_ARCHIVE
ib_uint64_t archived_lsn;
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index e763b7e7a37..785fe5d8226 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -235,7 +235,7 @@ static MYSQL_SYSVAR_ULONG(pagecache_age_threshold,
"until it is considered aged enough to be downgraded to a warm block. "
"This specifies the percentage ratio of that number of hits to the "
"total number of blocks in the page cache.", 0, 0,
- 300, 100, ~0L, 100);
+ 300, 100, ~ (ulong) 0L, 100);
static MYSQL_SYSVAR_ULONGLONG(pagecache_buffer_size, pagecache_buffer_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c
index 02cb01b581c..8e0407c9d7a 100644
--- a/storage/maria/ma_blockrec.c
+++ b/storage/maria/ma_blockrec.c
@@ -4677,6 +4677,8 @@ int _ma_read_block_record2(MARIA_HA *info, uchar *record,
MARIA_ROW *cur_row= &info->cur_row;
DBUG_ENTER("_ma_read_block_record2");
+ LINT_INIT(blob_buffer);
+
start_of_data= data;
flag= (uint) (uchar) data[0];
cur_null_bytes= share->base.original_null_bytes;
diff --git a/storage/maria/ma_ft_nlq_search.c b/storage/maria/ma_ft_nlq_search.c
index e57cc135ca1..5c1ab85ef8a 100644
--- a/storage/maria/ma_ft_nlq_search.c
+++ b/storage/maria/ma_ft_nlq_search.c
@@ -83,6 +83,8 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
#endif
DBUG_ENTER("walk_and_match");
+ LINT_INIT_STRUCT(subkeys);
+
word->weight=LWS_FOR_QUERY;
_ma_ft_make_key(info, &key, aio->keynr, keybuff, word, 0);
diff --git a/storage/maria/ma_key_recover.c b/storage/maria/ma_key_recover.c
index 9ff2d954a60..502ac2b8809 100644
--- a/storage/maria/ma_key_recover.c
+++ b/storage/maria/ma_key_recover.c
@@ -945,7 +945,10 @@ uint _ma_apply_redo_index(MARIA_HA *info,
const uchar *header_end= header + head_length;
uint page_offset= 0, org_page_length;
uint page_length, keypage_header, keynr;
- uint max_page_size= share->max_index_block_size, new_page_length= 0;
+ uint max_page_size= share->max_index_block_size;
+#ifndef DBUG_OFF
+ uint new_page_length= 0;
+#endif
int result;
MARIA_PAGE page;
DBUG_ENTER("_ma_apply_redo_index");
@@ -1107,7 +1110,9 @@ uint _ma_apply_redo_index(MARIA_HA *info,
DBUG_PRINT("redo", ("org_page_length: %u new_page_length: %u",
uint2korr(header), uint2korr(header+2)));
DBUG_ASSERT(uint2korr(header) == page_length);
+#ifndef DBUG_OFF
new_page_length= min(uint2korr(header+2), max_page_size);
+#endif
header+= 4;
break;
case KEY_OP_MAX_PAGELENGTH:
diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c
index 2618d6a5b50..6aaccea219f 100644
--- a/storage/maria/ma_pagecache.c
+++ b/storage/maria/ma_pagecache.c
@@ -3372,6 +3372,7 @@ restart:
PAGECACHE_BLOCK_LINK *block;
uint status;
int page_st;
+ LINT_INIT(page_st);
pagecache_pthread_mutex_lock(&pagecache->cache_lock);
if (!pagecache->can_be_used)
diff --git a/storage/maria/ma_search.c b/storage/maria/ma_search.c
index 3b774fb4283..ccb4bf77717 100644
--- a/storage/maria/ma_search.c
+++ b/storage/maria/ma_search.c
@@ -439,6 +439,10 @@ int _ma_prefix_search(const MARIA_KEY *key, const MARIA_PAGE *ma_page,
const uchar *sort_order= keyinfo->seg->charset->sort_order;
DBUG_ENTER("_ma_prefix_search");
+ LINT_INIT(seg_len_pack);
+ LINT_INIT(prefix_len);
+ LINT_INIT(length);
+
t_buff[0]=0; /* Avoid bugs */
page_flag= ma_page->flag;
nod_flag= ma_page->node;
diff --git a/storage/myisam/ft_nlq_search.c b/storage/myisam/ft_nlq_search.c
index 5a9468fe007..bafa7064e28 100644
--- a/storage/myisam/ft_nlq_search.c
+++ b/storage/myisam/ft_nlq_search.c
@@ -81,6 +81,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
#error
#endif
DBUG_ENTER("walk_and_match");
+ LINT_INIT_STRUCT(subkeys);
word->weight=LWS_FOR_QUERY;
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 90f7b990d23..f9068772b0c 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -12387,7 +12387,7 @@ static MYSQL_SYSVAR_BOOL(doublewrite, innobase_use_doublewrite,
static MYSQL_SYSVAR_ULONG(io_capacity, srv_io_capacity,
PLUGIN_VAR_RQCMDARG,
"Number of IOPs the server can do. Tunes the background IO rate",
- NULL, NULL, 200, 100, ~0L, 0);
+ NULL, NULL, 200, 100, ~ (ulong) 0L, 0);
static MYSQL_SYSVAR_ULONG(purge_batch_size, srv_purge_batch_size,
PLUGIN_VAR_OPCMDARG,
@@ -12520,7 +12520,7 @@ static MYSQL_SYSVAR_BOOL(adaptive_flushing, srv_adaptive_flushing,
static MYSQL_SYSVAR_ULONG(max_purge_lag, srv_max_purge_lag,
PLUGIN_VAR_RQCMDARG,
"Desired maximum length of the purge queue (0 = no limit)",
- NULL, NULL, 0, 0, ~0L, 0);
+ NULL, NULL, 0, 0, ~(ulong) 0L, 0);
static MYSQL_SYSVAR_BOOL(rollback_on_timeout, innobase_rollback_on_timeout,
PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
@@ -12624,7 +12624,7 @@ static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,
static MYSQL_SYSVAR_ULONG(concurrency_tickets, srv_n_free_tickets_to_enter,
PLUGIN_VAR_RQCMDARG,
"Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket",
- NULL, NULL, 500L, 1L, ~0L, 0);
+ NULL, NULL, 500L, 1L, ~(ulong) 0L, 0);
#ifdef EXTENDED_FOR_KILLIDLE
#define kill_idle_help_text "If non-zero value, the idle session with transaction which is idle over the value in seconds is killed by InnoDB."
@@ -12694,12 +12694,12 @@ static MYSQL_SYSVAR_LONG(open_files, innobase_open_files,
static MYSQL_SYSVAR_ULONG(sync_spin_loops, srv_n_spin_wait_rounds,
PLUGIN_VAR_RQCMDARG,
"Count of spin-loop rounds in InnoDB mutexes (30 by default)",
- NULL, NULL, 30L, 0L, ~0L, 0);
+ NULL, NULL, 30L, 0L, ~ (ulong) 0L, 0);
static MYSQL_SYSVAR_ULONG(spin_wait_delay, srv_spin_wait_delay,
PLUGIN_VAR_OPCMDARG,
"Maximum delay between polling for a spin lock (6 by default)",
- NULL, NULL, 6L, 0L, ~0L, 0);
+ NULL, NULL, 6L, 0L, ~ (ulong) 0L, 0);
static MYSQL_SYSVAR_BOOL(thread_concurrency_timer_based,
innobase_thread_concurrency_timer_based,
@@ -12715,7 +12715,7 @@ static MYSQL_SYSVAR_ULONG(thread_concurrency, srv_thread_concurrency,
static MYSQL_SYSVAR_ULONG(thread_sleep_delay, srv_thread_sleep_delay,
PLUGIN_VAR_RQCMDARG,
"Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep",
- NULL, NULL, 10000L, 0L, ~0L, 0);
+ NULL, NULL, 10000L, 0L, ~ (ulong) 0L, 0);
static MYSQL_SYSVAR_STR(data_file_path, innobase_data_file_path,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
diff --git a/storage/xtradb/log/log0recv.c b/storage/xtradb/log/log0recv.c
index c4429af5112..a554c576b6d 100644
--- a/storage/xtradb/log/log0recv.c
+++ b/storage/xtradb/log/log0recv.c
@@ -2980,7 +2980,7 @@ recv_recovery_from_checkpoint_start_func(
ib_uint64_t checkpoint_lsn;
ib_uint64_t checkpoint_no;
ib_uint64_t old_scanned_lsn;
- ib_uint64_t group_scanned_lsn;
+ ib_uint64_t group_scanned_lsn= 0;
ib_uint64_t contiguous_lsn;
#ifdef UNIV_LOG_ARCHIVE
ib_uint64_t archived_lsn;
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index 83ea3739f4c..52eaece5528 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -2317,13 +2317,18 @@ void my_fill_utf32(CHARSET_INFO *cs,
char *s, size_t slen, int fill)
{
char buf[10];
+#ifndef DBUG_OFF
uint buflen;
+#endif
char *e= s + slen;
DBUG_ASSERT((slen % 4) == 0);
- buflen= cs->cset->wc_mb(cs, (my_wc_t) fill, (uchar*) buf,
- (uchar*) buf + sizeof(buf));
+#ifndef DBUG_OFF
+ buflen=
+#endif
+ cs->cset->wc_mb(cs, (my_wc_t) fill, (uchar*) buf,
+ (uchar*) buf + sizeof(buf));
DBUG_ASSERT(buflen == 4);
while (s < e)
{