diff options
author | Guilhem Bichot <guilhem@mysql.com> | 2008-10-15 14:44:31 +0200 |
---|---|---|
committer | Guilhem Bichot <guilhem@mysql.com> | 2008-10-15 14:44:31 +0200 |
commit | 5aa1e3b364baf49075c9c1e827ba30488561de96 (patch) | |
tree | 541ec76614aed42dbf98eee44c8138beb1e39a16 | |
parent | 8ecda6cd2689defacec4c6c7aaeebaf2c7f78cfb (diff) | |
download | mariadb-git-5aa1e3b364baf49075c9c1e827ba30488561de96.tar.gz |
Small fixes for pushbuild: compiler warnings, checking that partitioning is enabled when testing it.
Don't fsync() index file when closing Maria table if not transactional.
mysql-test/suite/maria/r/maria.result:
piece moved
mysql-test/suite/maria/r/maria_partition.result:
result
mysql-test/suite/maria/t/maria.test:
- reset default storage engine at end of test, not in the middle
- move piece which requires partitioning, to maria_partition.test, otherwise test fails
on builds without partitioning compiled in
mysql-test/suite/maria/t/maria_partition.test:
new test for those Maria bugs which are specific of partitioning
mysys/my_uuid.c:
compiler warning fix (fix imported from latest 5.1-main)
storage/maria/ma_close.c:
don't fsync() index file when closing table if not transactional
(same test as in _ma_once_end_block_record() when fsync-ing data file)
storage/maria/ma_create.c:
compiler warning fix (char* assigned to uchar*)
storage/maria/ma_loghandler.c:
compiler warning fix (char* assigned to uchar*)
-rw-r--r-- | mysql-test/suite/maria/r/maria.result | 5 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/maria_partition.result | 12 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria.test | 23 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/maria_partition.test | 35 | ||||
-rw-r--r-- | mysys/my_uuid.c | 4 | ||||
-rw-r--r-- | storage/maria/ma_close.c | 2 | ||||
-rw-r--r-- | storage/maria/ma_create.c | 3 | ||||
-rw-r--r-- | storage/maria/ma_loghandler.c | 3 |
8 files changed, 61 insertions, 26 deletions
diff --git a/mysql-test/suite/maria/r/maria.result b/mysql-test/suite/maria/r/maria.result index dce6048db6c..43ce930d4d9 100644 --- a/mysql-test/suite/maria/r/maria.result +++ b/mysql-test/suite/maria/r/maria.result @@ -2590,11 +2590,6 @@ ALTER TABLE t1 CHANGE c d varchar(10); affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 drop table t1; -create table t1 (s1 int); -insert into t1 values (1); -alter table t1 partition by list (s1) (partition p1 values in (2)); -ERROR HY000: Table has no partition for value 1 -drop table t1; create table t1 (c1 int); create table t2 (c1 int); lock table t1 read, t2 read; diff --git a/mysql-test/suite/maria/r/maria_partition.result b/mysql-test/suite/maria/r/maria_partition.result new file mode 100644 index 00000000000..bab1df28d32 --- /dev/null +++ b/mysql-test/suite/maria/r/maria_partition.result @@ -0,0 +1,12 @@ +set global storage_engine=maria; +set session storage_engine=maria; +set global maria_page_checksum=0; +set global maria_log_file_size=4294967295; +drop table if exists t1,t2; +drop view if exists v1; +SET SQL_WARNINGS=1; +create table t1 (s1 int); +insert into t1 values (1); +alter table t1 partition by list (s1) (partition p1 values in (2)); +ERROR HY000: Table has no partition for value 1 +drop table t1; diff --git a/mysql-test/suite/maria/t/maria.test b/mysql-test/suite/maria/t/maria.test index 1271d70e864..86149bdbf31 100644 --- a/mysql-test/suite/maria/t/maria.test +++ b/mysql-test/suite/maria/t/maria.test @@ -1817,12 +1817,6 @@ lock table t1 write concurrent; delete from t1; drop table t1; ---disable_result_log ---disable_query_log -eval set global storage_engine=$default_engine, maria_page_checksum=$default_checksum; ---enable_result_log ---enable_query_log - # # Bug#39243 SELECT WHERE does not find row # (Problem with skip_row) @@ -1868,16 +1862,6 @@ ALTER TABLE t1 CHANGE c d varchar(10); drop table t1; # -# Bug #39227 Maria: crash with ALTER TABLE PARTITION -# - -create table t1 (s1 int); -insert into t1 values (1); ---error ER_NO_PARTITION_FOR_GIVEN_VALUE -alter table t1 partition by list (s1) (partition p1 values in (2)); -drop table t1; - -# # Bug #39226 Maria: crash with FLUSH TABLES WITH READ LOCK after LOCK TABLES create table t1 (c1 int); @@ -1886,3 +1870,10 @@ lock table t1 read, t2 read; flush tables with read lock; unlock tables; drop table t1, t2; + +# Set defaults back +--disable_result_log +--disable_query_log +eval set global storage_engine=$default_engine, maria_page_checksum=$default_checksum; +--enable_result_log +--enable_query_log diff --git a/mysql-test/suite/maria/t/maria_partition.test b/mysql-test/suite/maria/t/maria_partition.test new file mode 100644 index 00000000000..e923096b75e --- /dev/null +++ b/mysql-test/suite/maria/t/maria_partition.test @@ -0,0 +1,35 @@ +# Maria tests which require partitioning enabled + +--source include/have_partition.inc +-- source include/have_maria.inc + +let $default_engine=`select @@global.storage_engine`; +let $default_checksum=`select @@global.maria_page_checksum`; +set global storage_engine=maria; +set session storage_engine=maria; +set global maria_page_checksum=0; +set global maria_log_file_size=4294967295; + +# Initialise +--disable_warnings +drop table if exists t1,t2; +drop view if exists v1; +--enable_warnings +SET SQL_WARNINGS=1; + +# +# Bug #39227 Maria: crash with ALTER TABLE PARTITION +# + +create table t1 (s1 int); +insert into t1 values (1); +--error ER_NO_PARTITION_FOR_GIVEN_VALUE +alter table t1 partition by list (s1) (partition p1 values in (2)); +drop table t1; + +# Set defaults back +--disable_result_log +--disable_query_log +eval set global storage_engine=$default_engine, maria_page_checksum=$default_checksum; +--enable_result_log +--enable_query_log diff --git a/mysys/my_uuid.c b/mysys/my_uuid.c index ca5e94c4754..d1e8331aaa1 100644 --- a/mysys/my_uuid.c +++ b/mysys/my_uuid.c @@ -145,12 +145,12 @@ void my_uuid(uchar *to) */ if (nanoseq) { - long delta; + ulong delta; DBUG_ASSERT((tv > uuid_time) && (nanoseq > 0)); /* -1 so we won't make tv= uuid_time for nanoseq >= (tv - uuid_time) */ - delta= min(nanoseq, tv - uuid_time -1); + delta= min(nanoseq, (ulong)(tv - uuid_time -1)); tv-= delta; nanoseq-= delta; } diff --git a/storage/maria/ma_close.c b/storage/maria/ma_close.c index 266a095dd52..9463ad8078d 100644 --- a/storage/maria/ma_close.c +++ b/storage/maria/ma_close.c @@ -107,7 +107,7 @@ int maria_close(register MARIA_HA *info) File must be synced as it is going out of the maria_open_list and so becoming unknown to future Checkpoints. */ - if (!share->temporary && my_sync(share->kfile.file, MYF(MY_WME))) + if (share->now_transactional && my_sync(share->kfile.file, MYF(MY_WME))) error= my_errno; if (my_close(share->kfile.file, MYF(0))) error= my_errno; diff --git a/storage/maria/ma_create.c b/storage/maria/ma_create.c index 417397f0882..f12b9e5b483 100644 --- a/storage/maria/ma_create.c +++ b/storage/maria/ma_create.c @@ -1348,7 +1348,8 @@ int _ma_update_state_lsns_sub(MARIA_SHARE *share, LSN lsn, TrID create_trid, int res; LEX_CUSTRING log_array[TRANSLOG_INTERNAL_PARTS + 1]; /* table name is logged only for information */ - log_array[TRANSLOG_INTERNAL_PARTS + 0].str= share->open_file_name.str; + log_array[TRANSLOG_INTERNAL_PARTS + 0].str= + (uchar *)(share->open_file_name.str); log_array[TRANSLOG_INTERNAL_PARTS + 0].length= share->open_file_name.length + 1; if ((res= translog_write_record(&lsn, LOGREC_IMPORTED_TABLE, diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c index 5ed83356d30..0219572aa75 100644 --- a/storage/maria/ma_loghandler.c +++ b/storage/maria/ma_loghandler.c @@ -7717,7 +7717,8 @@ int translog_assign_id_to_share(MARIA_HA *tbl_info, TRN *trn) is not realpath-ed, etc) which is good: the log can be moved to another directory and continue working. */ - log_array[TRANSLOG_INTERNAL_PARTS + 1].str= share->open_file_name.str; + log_array[TRANSLOG_INTERNAL_PARTS + 1].str= + (uchar *)share->open_file_name.str; log_array[TRANSLOG_INTERNAL_PARTS + 1].length= share->open_file_name.length + 1; /* |