diff options
author | unknown <monty@mysql.com/narttu.mysql.fi> | 2007-01-26 13:32:02 +0200 |
---|---|---|
committer | unknown <monty@mysql.com/narttu.mysql.fi> | 2007-01-26 13:32:02 +0200 |
commit | 7412f0fa0cd498f06fe04966a6f6161e8b32d0a2 (patch) | |
tree | 6a07f5b0af3e1abb1dd5619884629b7afec30723 | |
parent | ca42b36cc99fa0fb1d12a3150316bf3164909a07 (diff) | |
download | mariadb-git-7412f0fa0cd498f06fe04966a6f6161e8b32d0a2.tar.gz |
After merge fixes
Removed compiler warnings
Fixed clashing function name in maria
Disable maria tests from MySQL level for now
BitKeeper/deleted/.del-ha_maria.cc:
Rename: libmysqld/ha_maria.cc -> BitKeeper/deleted/.del-ha_maria.cc
BitKeeper/etc/ignore:
added libmysqld/ha_maria.cc
---
added storage/maria/unittest/maria_control unittest/maria_control
---
added *.Tpo
---
added unittest/page_cache_test_file_1
---
added unittest/pagecache_debug.log
---
added unittest/mysys/mf_pagecache_consist_1k-t-big unittest/mysys/mf_pagecache_consist_1kHC-t-big unittest/mysys/mf_pagecache_consist_1kRD-t-big unittest/mysys/mf_pagecache_consist_1kWR-t-big unittest/mysys/mf_pagecache_consist_64k-t-big unittest/mysys/mf_pagecache_consist_64kHC-t-big unittest/mysys/mf_pagecache_consist_64kRD-t-big unittest/mysys/mf_pagecache_consist_64kWR-t-big
---
added unittest/mysys/mf_pagecache_single_64k-t-big
Makefile.am:
Don't run 'test-unit' by default (takes too long time)
client/mysqldump.c:
Fixed compiler warning
include/lf.h:
Remove compiler warnings about not used require_pins constant
include/pagecache.h:
LSN should be of type ulonglong
(This fixes some compiler warnings)
mysql-test/r/events_logs_tests.result:
Make test predictable
mysql-test/r/view.result:
Make test results predictable
mysql-test/t/disabled.def:
Disable maria tests for a while
mysql-test/t/events_logs_tests.test:
Make test predictable
mysql-test/t/view.test:
Make test results predictable
mysys/lf_alloc-pin.c:
#warning ->QQ
mysys/lf_hash.c:
#warning ->QQ
Removed compiler warnings
mysys/mf_pagecache.c:
Removed compiler warnings
mysys/my_rename.c:
Removed compiler warnings
plugin/daemon_example/daemon_example.c:
Remove compiler warning
sql/ha_ndbcluster.cc:
Remove compiler warning
sql/udf_example.c:
Remove compiler warning
storage/maria/lockman.c:
Changed #warnings to QQ comment
Removed compiler warnings
storage/maria/ma_blockrec.c:
Removed compiler warnings
storage/maria/ma_check.c:
After merge fixes
storage/maria/ma_key.c:
After merge fixes
storage/maria/ma_packrec.c:
After merge fixes
storage/maria/ma_rkey.c:
After merge fixes
storage/maria/ma_sort.c:
After merge fixes
storage/maria/ma_sp_defs.h:
Rename clashing function name
storage/maria/ma_sp_key.c:
Rename clashing function name
storage/maria/ma_test_all.res:
New test results
storage/maria/ma_unique.c:
Fixed compiler warning
storage/maria/tablockman.c:
#warning -> QQ
storage/maria/tablockman.h:
#warning -> QQ
storage/maria/trnman.c:
#warning -> QQ
storage/maria/unittest/lockman2-t.c:
Removed compiler warnings
storage/maria/unittest/ma_control_file-t.c:
Removed warning for 'maria_control' file not found
storage/maria/unittest/trnman-t.c:
Removed compiler warnings
storage/ndb/src/mgmapi/mgmapi.cpp:
Remove compiler warnings
unittest/mysys/mf_pagecache_consist.c:
Removed compiler warnings
unittest/mysys/my_atomic-t.c:
Removed compiler warnings
37 files changed, 261 insertions, 181 deletions
diff --git a/.bzrignore b/.bzrignore index bd7941f77ab..7dd012950d8 100644 --- a/.bzrignore +++ b/.bzrignore @@ -2946,3 +2946,18 @@ win/vs71cache.txt win/vs8cache.txt zlib/*.ds? zlib/*.vcproj +libmysqld/ha_maria.cc +storage/maria/unittest/maria_control +unittest/maria_control +*.Tpo +unittest/page_cache_test_file_1 +unittest/pagecache_debug.log +unittest/mysys/mf_pagecache_consist_1k-t-big +unittest/mysys/mf_pagecache_consist_1kHC-t-big +unittest/mysys/mf_pagecache_consist_1kRD-t-big +unittest/mysys/mf_pagecache_consist_1kWR-t-big +unittest/mysys/mf_pagecache_consist_64k-t-big +unittest/mysys/mf_pagecache_consist_64kHC-t-big +unittest/mysys/mf_pagecache_consist_64kRD-t-big +unittest/mysys/mf_pagecache_consist_64kWR-t-big +unittest/mysys/mf_pagecache_single_64k-t-big diff --git a/Makefile.am b/Makefile.am index 81656d67f74..ed2f8d99414 100644 --- a/Makefile.am +++ b/Makefile.am @@ -137,9 +137,9 @@ test-binlog-statement: cd mysql-test ; \ ./mysql-test-run.pl $(force) --mysqld=--binlog-format=statement -test: test-unit test-ns test-pr +test: test-ns test-pr -test-full: test test-nr test-ps +test-full: test-unit test test-nr test-ps test-force: $(MAKE) force=--force test diff --git a/client/mysqldump.c b/client/mysqldump.c index 5d87701fe10..0d6b5678e52 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2877,7 +2877,7 @@ static int dump_tablespaces_for_tables(char *db, char **table_names, int tables) dynstr_trunc(&where, 1); dynstr_append(&where,"))"); - DBUG_PRINT("info",("Dump TS for Tables where: %s",where)); + DBUG_PRINT("info",("Dump TS for Tables where: %s",where.str)); r= dump_tablespaces(where.str); dynstr_free(&where); return r; @@ -2907,7 +2907,7 @@ static int dump_tablespaces_for_databases(char** databases) dynstr_trunc(&where, 1); dynstr_append(&where,"))"); - DBUG_PRINT("info",("Dump TS for DBs where: %s",where)); + DBUG_PRINT("info",("Dump TS for DBs where: %s",where.str)); r= dump_tablespaces(where.str); dynstr_free(&where); return r; diff --git a/include/lf.h b/include/lf.h index c161bd5044d..39a47e6568a 100644 --- a/include/lf.h +++ b/include/lf.h @@ -135,8 +135,9 @@ typedef struct { */ #if defined(__GNUC__) && defined(MY_LF_EXTRA_DEBUG) #define LF_REQUIRE_PINS(N) \ - static const char require_pins[LF_PINBOX_PINS-N]; \ + static const char require_pins[LF_PINBOX_PINS-N] __attribute__ ((unused)); \ static const int LF_NUM_PINS_IN_THIS_FILE= N + #define _lf_pin(PINS, PIN, ADDR) \ ( \ assert(PIN < LF_NUM_PINS_IN_THIS_FILE), \ diff --git a/include/pagecache.h b/include/pagecache.h index 418e0203f64..b698a36a5e4 100644 --- a/include/pagecache.h +++ b/include/pagecache.h @@ -73,7 +73,7 @@ typedef void *PAGECACHE_PAGE_LINK; /* TODO: move to loghandler emulator */ typedef void LOG_HANDLER; -typedef void *LSN; +typedef ulonglong LSN; /* file descriptor for Maria */ typedef struct st_pagecache_file diff --git a/mysql-test/r/events_logs_tests.result b/mysql-test/r/events_logs_tests.result index 335ca848387..b067b2011e1 100644 --- a/mysql-test/r/events_logs_tests.result +++ b/mysql-test/r/events_logs_tests.result @@ -83,7 +83,7 @@ slo_val val 4 0 1 0 "Check slow log. Should see 1 row because 4 is over the threshold of 3 for GLOBAL, though under SESSION which is 10" -SELECT user_host, query_time, db, sql_text FROM mysql.slow_log; +SELECT user_host, query_time, db, sql_text FROM mysql.slow_log where sql_text <> "DROP EVENT long_event"; user_host query_time db sql_text USER_HOST SLEEPVAL events_test INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2) DROP EVENT long_event2; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 4bc122cc97b..eb090658560 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -2684,10 +2684,12 @@ FROM t1 HAVING Age < 75; SHOW CREATE VIEW v1; View Create View v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(now()) - year(`t1`.`DOB`)) AS `Age` from `t1` having (`Age` < 75) +set timestamp=1136066400; SELECT (year(now())-year(DOB)) AS Age FROM t1 HAVING Age < 75; Age 42 38 +set timestamp=1136066400; SELECT * FROM v1; Age 42 @@ -3014,6 +3016,15 @@ i j 6 3 DROP VIEW v1, v2; DROP TABLE t1; +DROP VIEW IF EXISTS v1; +CREATE VIEW v1 AS SELECT 'The\ZEnd'; +SELECT * FROM v1; +TheEnd +ThezEnd +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select _latin1'ThezEnd' AS `TheEnd` +DROP VIEW v1; End of 5.0 tests. DROP DATABASE IF EXISTS `d-1`; CREATE DATABASE `d-1`; diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index c36ac1bd168..3b063841512 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -38,3 +38,5 @@ ndb_autodiscover3 : bug#21806 flush2 : Bug#24805 Pushbuild can't handle test with --disable-log-bin +maria : Until maria is fully functional +ps_maria : Until maria is fully functional diff --git a/mysql-test/t/events_logs_tests.test b/mysql-test/t/events_logs_tests.test index aee16595ef9..001004386e4 100644 --- a/mysql-test/t/events_logs_tests.test +++ b/mysql-test/t/events_logs_tests.test @@ -91,7 +91,7 @@ CREATE EVENT long_event2 ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_te SELECT * FROM slow_event_test; --echo "Check slow log. Should see 1 row because 4 is over the threshold of 3 for GLOBAL, though under SESSION which is 10" --replace_column 1 USER_HOST 2 SLEEPVAL -SELECT user_host, query_time, db, sql_text FROM mysql.slow_log; +SELECT user_host, query_time, db, sql_text FROM mysql.slow_log where sql_text <> "DROP EVENT long_event"; DROP EVENT long_event2; --echo "Make it quite long" SET SESSION long_query_time=300; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 7175db1db4e..3c5308a935c 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -2553,7 +2553,9 @@ CREATE VIEW v1 AS FROM t1 HAVING Age < 75; SHOW CREATE VIEW v1; +set timestamp=1136066400; SELECT (year(now())-year(DOB)) AS Age FROM t1 HAVING Age < 75; +set timestamp=1136066400; SELECT * FROM v1; DROP VIEW v1; @@ -2906,6 +2908,7 @@ DROP FUNCTION f1; DROP VIEW v1; DROP TABLE t1; +# # Bug #16813 (WITH CHECK OPTION doesn't work with UPDATE) # CREATE TABLE t1(id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, val INT UNSIGNED NOT NULL); @@ -2919,7 +2922,6 @@ UPDATE v1 SET val=6 WHERE id=2; DROP VIEW v1; DROP TABLE t1; - # # BUG#22584: last_insert_id not updated after inserting a record # through a updatable view @@ -2957,6 +2959,20 @@ SELECT * FROM t1; DROP VIEW v1, v2; DROP TABLE t1; +# +# BUG#24293: '\Z' token is not handled correctly in views +# + +--disable_warnings +DROP VIEW IF EXISTS v1; +--enable_warnings + +CREATE VIEW v1 AS SELECT 'The\ZEnd'; +SELECT * FROM v1; + +SHOW CREATE VIEW v1; + +DROP VIEW v1; --echo End of 5.0 tests. diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c index d0fa29ddaaf..e964553a64c 100644 --- a/mysys/lf_alloc-pin.c +++ b/mysys/lf_alloc-pin.c @@ -1,4 +1,4 @@ -#warning TODO multi-pinbox +/* QQ: TODO multi-pinbox */ /* Copyright (C) 2000 MySQL AB This program is free software; you can redistribute it and/or modify diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c index b2ad7a93ace..fb2fb88492f 100644 --- a/mysys/lf_hash.c +++ b/mysys/lf_hash.c @@ -86,7 +86,7 @@ retry: if (!cursor->curr) return 0; do { -#warning XXX or goto retry ? + /* QQ: XXX or goto retry ? */ link= cursor->curr->link; cursor->next= PTR(link); _lf_pin(pins, 0, cursor->next); @@ -105,7 +105,8 @@ retry: { int r= 1; if (cur_hashnr > hashnr || - (r= my_strnncoll(cs, cur_key, cur_keylen, key, keylen)) >= 0) + (r= my_strnncoll(cs, (uchar*) cur_key, cur_keylen, (uchar*) key, + keylen)) >= 0) return !r; } cursor->prev= &(cursor->curr->link); @@ -243,7 +244,8 @@ static inline const byte* hash_key(const LF_HASH *hash, static inline uint calc_hash(LF_HASH *hash, const byte *key, uint keylen) { ulong nr1= 1, nr2= 4; - hash->charset->coll->hash_sort(hash->charset, key, keylen, &nr1, &nr2); + hash->charset->coll->hash_sort(hash->charset, (uchar*) key, keylen, + &nr1, &nr2); return nr1 & INT_MAX32; } @@ -375,7 +377,7 @@ void *lf_hash_search(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen) return found ? found+1 : 0; } -static char *dummy_key= ""; +static const char *dummy_key= ""; static void initialize_bucket(LF_HASH *hash, LF_SLIST * volatile *node, uint bucket, LF_PINS *pins) @@ -387,7 +389,7 @@ static void initialize_bucket(LF_HASH *hash, LF_SLIST * volatile *node, if (*el == NULL && bucket) initialize_bucket(hash, el, parent, pins); dummy->hashnr= my_reverse_bits(bucket); - dummy->key= dummy_key; + dummy->key= (char*) dummy_key; dummy->keylen= 0; if ((cur= linsert(el, hash->charset, dummy, pins, 0))) { @@ -396,4 +398,3 @@ static void initialize_bucket(LF_HASH *hash, LF_SLIST * volatile *node, } my_atomic_casptr((void **)node, (void **)&tmp, dummy); } - diff --git a/mysys/mf_pagecache.c b/mysys/mf_pagecache.c index 5f4e8d1a97d..0116dfabfa1 100755 --- a/mysys/mf_pagecache.c +++ b/mysys/mf_pagecache.c @@ -47,7 +47,6 @@ #include <errno.h> #include <stdarg.h> - /* Some compilation flags have been added specifically for this module to control the following: @@ -429,7 +428,6 @@ error: #define FLUSH_CACHE 2000 /* sort this many blocks at once */ -static int flush_all_key_blocks(PAGECACHE *pagecache); #ifdef THREAD static void link_into_queue(PAGECACHE_WQUEUE *wqueue, struct st_my_thread_var *thread); @@ -794,6 +792,40 @@ err: /* + Flush all blocks in the key cache to disk +*/ + +#ifdef NOT_USED +static int flush_all_key_blocks(PAGECACHE *pagecache) +{ +#if defined(PAGECACHE_DEBUG) + uint cnt=0; +#endif + while (pagecache->blocks_changed > 0) + { + PAGECACHE_BLOCK_LINK *block; + for (block= pagecache->used_last->next_used ; ; block=block->next_used) + { + if (block->hash_link) + { +#if defined(PAGECACHE_DEBUG) + cnt++; + KEYCACHE_DBUG_ASSERT(cnt <= pagecache->blocks_used); +#endif + if (flush_pagecache_blocks_int(pagecache, &block->hash_link->file, + FLUSH_RELEASE)) + return 1; + break; + } + if (block == pagecache->used_last) + break; + } + } + return 0; +} +#endif /* NOT_USED */ + +/* Resize a key cache SYNOPSIS @@ -827,7 +859,7 @@ err: resizing, due to the page locking specific to this page cache. So we disable it for now. */ -#if 0 /* keep disabled until code is fixed see above !! */ +#if NOT_USED /* keep disabled until code is fixed see above !! */ int resize_pagecache(PAGECACHE *pagecache, my_size_t use_mem, uint division_limit, uint age_threshold) @@ -1383,7 +1415,7 @@ static void unlink_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block) (ulong)block, BLOCK_NUMBER(pagecache, block), block->status, block->requests, pagecache->blocks_available)); BLOCK_INFO(block); - KEYCACHE_DBUG_ASSERT(pagecache->blocks_available >= 0); + KEYCACHE_DBUG_ASSERT((int) pagecache->blocks_available >= 0); #endif } @@ -2511,7 +2543,7 @@ void pagecache_unlock_page(PAGECACHE *pagecache, DBUG_ASSERT(lock == PAGECACHE_LOCK_WRITE_UNLOCK && pin == PAGECACHE_UNPIN); /* TODO: insert LSN writing code */ - DBUG_ASSERT(first_REDO_LSN_for_page > 0); + DBUG_ASSERT(first_REDO_LSN_for_page != 0); set_if_bigger(block->rec_lsn, first_REDO_LSN_for_page); } @@ -2675,7 +2707,7 @@ void pagecache_unlock(PAGECACHE *pagecache, DBUG_ASSERT(lock == PAGECACHE_LOCK_WRITE_UNLOCK && pin == PAGECACHE_UNPIN); /* TODO: insert LSN writing code */ - DBUG_ASSERT(first_REDO_LSN_for_page > 0); + DBUG_ASSERT(first_REDO_LSN_for_page != 0); set_if_bigger(block->rec_lsn, first_REDO_LSN_for_page); } @@ -3251,7 +3283,9 @@ restart: #ifndef DBUG_OFF int rc= #endif -#warning we are doing an unlock here, so need to give the page its rec_lsn! + /* + QQ: We are doing an unlock here, so need to give the page its rec_lsn + */ pagecache_make_lock_and_pin(pagecache, block, write_lock_change_table[lock].unlock_lock, write_pin_change_table[pin].unlock_pin); @@ -3612,11 +3646,14 @@ restart: else { /* Link the block into a list of blocks 'in switch' */ -#warning this unlink_changed() is a serious problem for Maria's Checkpoint: it \ -removes a page from the list of dirty pages, while it's still dirty. A \ - solution is to abandon first_in_switch, just wait for this page to be \ - flushed by somebody else, and loop. TODO: check all places where we remove a \ - page from the list of dirty pages + /* QQ: + #warning this unlink_changed() is a serious problem for + Maria's Checkpoint: it removes a page from the list of dirty + pages, while it's still dirty. A solution is to abandon + first_in_switch, just wait for this page to be + flushed by somebody else, and loop. TODO: check all places + where we remove a page from the list of dirty pages + */ unlink_changed(block); link_changed(block, &first_in_switch); } @@ -3728,39 +3765,6 @@ int flush_pagecache_blocks(PAGECACHE *pagecache, /* - Flush all blocks in the key cache to disk -*/ - -static int flush_all_key_blocks(PAGECACHE *pagecache) -{ -#if defined(PAGECACHE_DEBUG) - uint cnt=0; -#endif - while (pagecache->blocks_changed > 0) - { - PAGECACHE_BLOCK_LINK *block; - for (block= pagecache->used_last->next_used ; ; block=block->next_used) - { - if (block->hash_link) - { -#if defined(PAGECACHE_DEBUG) - cnt++; - KEYCACHE_DBUG_ASSERT(cnt <= pagecache->blocks_used); -#endif - if (flush_pagecache_blocks_int(pagecache, &block->hash_link->file, - FLUSH_RELEASE)) - return 1; - break; - } - if (block == pagecache->used_last) - break; - } - } - return 0; -} - - -/* Reset the counters of a key cache. SYNOPSIS @@ -3876,7 +3880,7 @@ my_bool pagecache_collect_changed_blocks_with_lsn(PAGECACHE *pagecache, 1) and 2) are critical problems. TODO: fix this when Monty has explained how he writes BLOB pages. */ - if (0 == block->rec_lsn) + if (block->rec_lsn == 0) { DBUG_ASSERT(0); goto err; @@ -3908,7 +3912,7 @@ my_bool pagecache_collect_changed_blocks_with_lsn(PAGECACHE *pagecache, ptr+= 4; int4store(ptr, block->hash_link->pageno); ptr+= 4; - int8store(ptr, (ulonglong)block->rec_lsn); + int8store(ptr, (ulonglong) block->rec_lsn); ptr+= 8; set_if_bigger(*max_lsn, block->rec_lsn); } diff --git a/mysys/my_rename.c b/mysys/my_rename.c index 8c2a354324b..c3870db177d 100644 --- a/mysys/my_rename.c +++ b/mysys/my_rename.c @@ -17,8 +17,9 @@ #include "mysys_priv.h" #include <my_dir.h> #include "mysys_err.h" - +#include "m_string.h" #undef my_rename + /* On unix rename deletes to file if it exists */ int my_rename(const char *from, const char *to, myf MyFlags) diff --git a/plugin/daemon_example/daemon_example.c b/plugin/daemon_example/daemon_example.c index d302aec6515..786ff199c93 100644 --- a/plugin/daemon_example/daemon_example.c +++ b/plugin/daemon_example/daemon_example.c @@ -40,7 +40,7 @@ 1 failure (cannot happen) */ -static int daemon_example_plugin_init(void *p) +static int daemon_example_plugin_init(void *p __attribute__ ((unused))) { return(0); } @@ -59,7 +59,7 @@ static int daemon_example_plugin_init(void *p) */ -static int daemon_example_plugin_deinit(void *p) +static int daemon_example_plugin_deinit(void *p __attribute__ ((unused))) { return(0); } diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 0362b8bf215..0c3a79baacc 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -7297,9 +7297,9 @@ static byte *ndbcluster_get_key(NDB_SHARE *share,uint *length, static void print_share(const char* where, NDB_SHARE* share) { fprintf(DBUG_FILE, - "%s %s.%s: use_count: %u, commit_count: %llu\n", + "%s %s.%s: use_count: %u, commit_count: %lu\n", where, share->db, share->table_name, share->use_count, - share->commit_count); + (ulong) share->commit_count); fprintf(DBUG_FILE, " - key: %s, key_length: %d\n", share->key, share->key_length); diff --git a/sql/udf_example.c b/sql/udf_example.c index bbab47e253d..a71cc4b44f2 100644 --- a/sql/udf_example.c +++ b/sql/udf_example.c @@ -1087,7 +1087,7 @@ my_bool is_const_init(UDF_INIT *initid, UDF_ARGS *args, char *message) strmov(message, "IS_CONST accepts only one argument"); return 1; } - initid->ptr= (char*)((args->args[0] != NULL) ? 1 : 0); + initid->ptr= (char*)(size_t)((args->args[0] != NULL) ? 1 : 0); return 0; } diff --git a/storage/maria/lockman.c b/storage/maria/lockman.c index 7672fadb068..fdacda84875 100644 --- a/storage/maria/lockman.c +++ b/storage/maria/lockman.c @@ -1,6 +1,7 @@ -#warning TODO - allocate everything from dynarrays !!! (benchmark) -#warning TODO instant duration locks -#warning automatically place S instead of LS if possible +/* QQ: TODO - allocate everything from dynarrays !!! (benchmark) */ +/* QQ: TODO instant duration locks */ +/* QQ: #warning automatically place S instead of LS if possible */ + /* Copyright (C) 2006 MySQL AB This program is free software; you can redistribute it and/or modify @@ -218,7 +219,7 @@ typedef struct lockman_lock { struct lockman_lock *lonext; intptr volatile link; uint32 hashnr; -#warning TODO - remove hashnr from LOCK + /* QQ: TODO - remove hashnr from LOCK */ uint16 loid; uchar lock; /* sizeof(uchar) <= sizeof(enum) */ uchar flags; @@ -428,9 +429,11 @@ static int lockinsert(LOCK * volatile *head, LOCK *node, LF_PINS *pins, } if (res & LOCK_UPGRADE) cursor.upgrade_from->flags|= IGNORE_ME; -#warning is this OK ? if a reader has already read upgrade_from, \ - it may find it conflicting with node :( -#warning another bug - see the last test from test_lockman_simple() + /* + QQ: is this OK ? if a reader has already read upgrade_from, + it may find it conflicting with node :( + - see the last test from test_lockman_simple() + */ } } while (res == REPEAT_ONCE_MORE); @@ -673,7 +676,7 @@ enum lockman_getlock_result lockman_getlock(LOCKMAN *lm, LOCK_OWNER *lo, belong to _some_ LOCK_OWNER. It means, we can never free() a LOCK_OWNER, if there're other active LOCK_OWNERs. */ -#warning race condition here + /* QQ: race condition here */ pthread_mutex_lock(wait_for_lo->mutex); if (DELETED(blocker->link)) { @@ -749,7 +752,7 @@ int lockman_release_locks(LOCKMAN *lm, LOCK_OWNER *lo) } #ifdef MY_LF_EXTRA_DEBUG -static char *lock2str[]= +static const char *lock2str[]= { "N", "S", "X", "IS", "IX", "SIX", "LS", "LX", "SLX", "LSIX" }; /* NOTE @@ -764,8 +767,9 @@ void print_lockhash(LOCKMAN *lm) intptr next= el->link; if (el->hashnr & 1) { - printf("0x%08x { resource %llu, loid %u, lock %s", - el->hashnr, el->resource, el->loid, lock2str[el->lock]); + printf("0x%08lx { resource %lu, loid %u, lock %s", + (long) el->hashnr, (ulong) el->resource, el->loid, + lock2str[el->lock]); if (el->flags & IGNORE_ME) printf(" IGNORE_ME"); if (el->flags & UPGRADED) printf(" UPGRADED"); if (el->flags & ACTIVE) printf(" ACTIVE"); @@ -781,4 +785,3 @@ void print_lockhash(LOCKMAN *lm) } } #endif - diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c index 6eac151d76e..f1345b2c2f3 100644 --- a/storage/maria/ma_blockrec.c +++ b/storage/maria/ma_blockrec.c @@ -967,7 +967,8 @@ static my_bool write_full_pages(MARIA_HA *info, my_off_t position; DBUG_ENTER("write_full_pages"); DBUG_PRINT("enter", ("length: %lu page: %lu page_count: %lu", - length, (ulong) block->page, block->page_count)); + (ulong) length, (ulong) block->page, + (ulong) block->page_count)); info->keybuff_used= 1; page= block->page; @@ -988,7 +989,7 @@ static my_bool write_full_pages(MARIA_HA *info, page= block->page; page_count= block->page_count - 1; DBUG_PRINT("info", ("page: %lu page_count: %lu", - (ulong) block->page, block->page_count)); + (ulong) block->page, (ulong) block->page_count)); position= (page + page_count + 1) * block_size; if (info->state->data_file_length < position) @@ -2387,18 +2388,18 @@ int _ma_read_block_record2(MARIA_HA *info, byte *record, blob_buffer+= blob_length; break; } -#ifdef EXTRA_DEBUG default: +#ifdef EXTRA_DEBUG DBUG_ASSERT(0); /* purecov: deadcode */ - goto err; #endif + goto err; } continue; } if (row_extents) { - DBUG_PRINT("info", ("Row read: page_count: %lu extent_count: %lu", + DBUG_PRINT("info", ("Row read: page_count: %u extent_count: %u", extent.page_count, extent.extent_count)); *extent.tail_positions= 0; /* End marker */ if (extent.page_count) diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index 682ce276a5b..ccce19de994 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -1078,6 +1078,10 @@ static int check_dynamic_record(HA_CHECK *param, MARIA_HA *info, int extend, char llbuff[22],llbuff2[22],llbuff3[22]; DBUG_ENTER("check_dynamic_record"); + LINT_INIT(left_length); + LINT_INIT(start_recpos); + LINT_INIT(to); + pos= 0; while (pos < info->state->data_file_length) { @@ -1096,7 +1100,8 @@ static int check_dynamic_record(HA_CHECK *param, MARIA_HA *info, int extend, (flag ? 0 : READING_NEXT) | READING_HEADER)) { _ma_check_print_error(param, - "got error: %d when reading datafile at position: %s", + "got error: %d when reading datafile at " + "position: %s", my_errno, llstr(start_block, llbuff)); DBUG_RETURN(1); } @@ -1309,7 +1314,8 @@ static int check_compressed_record(HA_CHECK *param, MARIA_HA *info, int extend, start_recpos= pos; param->splits++; VOID(_ma_pack_get_block_info(info, &info->bit_buff, &block_info, - &info->rec_buff, -1, start_recpos)); + &info->rec_buff, &info->rec_buff_size, -1, + start_recpos)); pos=block_info.filepos+block_info.rec_len; if (block_info.rec_len < (uint) info->s->min_pack_length || block_info.rec_len > (uint) info->s->max_pack_length) @@ -1727,7 +1733,7 @@ int maria_chk_data_link(HA_CHECK *param, MARIA_HA *info,int extend) param->used= param->link_used= param->splits= param->del_length= 0; param->tmp_record_checksum= param->glob_crc= 0; param->err_count= 0; - LINT_INIT(left_length); LINT_INIT(start_recpos); LINT_INIT(to); + error= 0; param->empty= info->s->pack.header_length; @@ -2206,7 +2212,7 @@ static int writekeys(MARIA_SORT_PARAM *sort_param) } /* Remove checksum that was added to glob_crc in sort_get_next_record */ if (sort_param->calc_checksum) - sort_param->glob_crc-= info->cur_row.checksum; + sort_param->sort_info->param->glob_crc-= info->cur_row.checksum; DBUG_PRINT("error",("errno: %d",my_errno)); DBUG_RETURN(-1); } /* writekeys */ @@ -2317,8 +2323,7 @@ int maria_sort_index(HA_CHECK *param, register MARIA_HA *info, my_string name) param->temp_filename); DBUG_RETURN(-1); } - if (new_header_length && - maria_filecopy(param, new_file,share->kfile,0L, + if (maria_filecopy(param, new_file,share->kfile,0L, (ulong) share->base.keystart, "headerblock")) goto err; @@ -3070,8 +3075,9 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info, param->temp_filename); goto err; } - if (maria_filecopy(param, new_file,info->dfile,0L,new_header_length, - "datafile-header")) + if (new_header_length && + maria_filecopy(param, new_file,info->dfile,0L,new_header_length, + "datafile-header")) goto err; if (param->testflag & T_UNPACK) restore_data_file_type(share); @@ -3814,16 +3820,18 @@ static int sort_get_next_record(MARIA_SORT_PARAM *sort_param) if (left_length < block_info.data_len || ! block_info.data_len) { _ma_check_print_info(param, - "Found block with too small length at %s; Skipped", - llstr(sort_param->start_recpos,llbuff)); + "Found block with too small length at %s; " + "Skipped", + llstr(sort_param->start_recpos,llbuff)); goto try_next; } if (block_info.filepos + block_info.data_len > sort_param->read_cache.end_of_file) { _ma_check_print_info(param, - "Found block that points outside data file at %s", - llstr(sort_param->start_recpos,llbuff)); + "Found block that points outside data file " + "at %s", + llstr(sort_param->start_recpos,llbuff)); goto try_next; } /* @@ -3923,7 +3931,9 @@ static int sort_get_next_record(MARIA_SORT_PARAM *sort_param) } sort_param->start_recpos=sort_param->pos; if (_ma_pack_get_block_info(info, &sort_param->bit_buff, &block_info, - &sort_param->rec_buff, -1, sort_param->pos)) + &sort_param->rec_buff, + &sort_param->rec_buff_size, -1, + sort_param->pos)) DBUG_RETURN(-1); if (!block_info.rec_len && sort_param->pos + MEMMAP_EXTRA_MARGIN == diff --git a/storage/maria/ma_key.c b/storage/maria/ma_key.c index deab2b9c983..036fd305c4d 100644 --- a/storage/maria/ma_key.c +++ b/storage/maria/ma_key.c @@ -64,7 +64,7 @@ uint _ma_make_key(register MARIA_HA *info, uint keynr, byte *key, TODO: nulls processing */ #ifdef HAVE_SPATIAL - DBUG_RETURN(sp_make_key(info,keynr, key,record,filepos)); + DBUG_RETURN(_ma_sp_make_key(info,keynr, key,record,filepos)); #else DBUG_ASSERT(0); /* maria_open should check that this never happens*/ #endif @@ -113,10 +113,10 @@ uint _ma_make_key(register MARIA_HA *info, uint keynr, byte *key, } else { - byte *end= pos + length; + const byte *end= pos + length; while (pos < end && pos[0] == ' ') pos++; - length=(uint) (end-pos); + length= (uint) (end-pos); } FIX_LENGTH(cs, pos, length, char_length); store_key_length_inc(key,char_length); diff --git a/storage/maria/ma_packrec.c b/storage/maria/ma_packrec.c index 6e481c0bc6d..7c875e7b91d 100644 --- a/storage/maria/ma_packrec.c +++ b/storage/maria/ma_packrec.c @@ -1288,7 +1288,7 @@ _ma_mempack_get_block_info(MARIA_HA *maria, header+= read_pack_length((uint) maria->s->pack.version, header, &info->blob_len); /* _ma_alloc_rec_buff sets my_errno on error */ - if (_ma_alloc_buffer(rec_buff_p, rec_buff_size, + if (_ma_alloc_buffer(rec_buff_p, rec_buff_size_p, info->blob_len + maria->s->base.extra_rec_buff_size)) return 0; /* not enough memory */ bit_buff->blob_pos= (uchar*) *rec_buff_p; diff --git a/storage/maria/ma_rkey.c b/storage/maria/ma_rkey.c index 17eae760a3a..ad27d3c286c 100644 --- a/storage/maria/ma_rkey.c +++ b/storage/maria/ma_rkey.c @@ -123,7 +123,8 @@ int maria_rkey(MARIA_HA *info, byte *buf, int inx, const byte *key, value. */ if (search_flag == HA_READ_KEY_EXACT && - ha_key_cmp(keyinfo->seg, key_buff, info->lastkey, use_key_length, + ha_key_cmp(keyinfo->seg, (uchar*) key_buff, + (uchar*) info->lastkey, use_key_length, SEARCH_FIND, not_used)) { my_errno= HA_ERR_KEY_NOT_FOUND; diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c index b63f99379ea..9134645f847 100644 --- a/storage/maria/ma_sort.c +++ b/storage/maria/ma_sort.c @@ -534,8 +534,7 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param) (ulonglong) info->state->records); } my_free((gptr) sinfo->sort_keys,MYF(0)); - my_free(_ma_get_rec_buff_ptr(info, sinfo->rec_buff), - MYF(MY_ALLOW_ZERO_PTR)); + my_free(sinfo->rec_buff, MYF(MY_ALLOW_ZERO_PTR)); sinfo->sort_keys=0; } diff --git a/storage/maria/ma_sp_defs.h b/storage/maria/ma_sp_defs.h index 8b9dd204ded..6aac741bb2c 100644 --- a/storage/maria/ma_sp_defs.h +++ b/storage/maria/ma_sp_defs.h @@ -41,8 +41,8 @@ enum wkbByteOrder wkbNDR = 1 /* Little Endian */ }; -uint sp_make_key(register MARIA_HA *info, uint keynr, byte *key, - const byte *record, my_off_t filepos); +uint _ma_sp_make_key(register MARIA_HA *info, uint keynr, byte *key, + const byte *record, my_off_t filepos); #endif /*HAVE_SPATIAL*/ #endif /* _SP_DEFS_H */ diff --git a/storage/maria/ma_sp_key.c b/storage/maria/ma_sp_key.c index 79345550dd9..b365f8deb0f 100644 --- a/storage/maria/ma_sp_key.c +++ b/storage/maria/ma_sp_key.c @@ -37,8 +37,8 @@ static void get_double(double *d, const byte *pos) float8get(*d, pos); } -uint sp_make_key(register MARIA_HA *info, uint keynr, byte *key, - const byte *record, my_off_t filepos) +uint _ma_sp_make_key(register MARIA_HA *info, uint keynr, byte *key, + const byte *record, my_off_t filepos) { HA_KEYSEG *keyseg; MARIA_KEYDEF *keyinfo = &info->s->keyinfo[keynr]; diff --git a/storage/maria/ma_test_all.res b/storage/maria/ma_test_all.res index 7ffd3378b51..57b0feeeae8 100644 --- a/storage/maria/ma_test_all.res +++ b/storage/maria/ma_test_all.res @@ -1,53 +1,62 @@ -maria_chk: MARIA file test1 -maria_chk: warning: Size of indexfile is: 8192 Should be: 16384 -MARIA-table 'test1' is usable but should be fixed +Running tests with dynamic row format +Running tests with static row format +Running tests with block row format ma_test2 -s -L -K -R1 -m2000 ; Should give error 135 -Error: 135 in write at record: 1105 +Error: 135 in write at record: 1099 got error: 135 when using MARIA-database +./maria_chk -sm test2 will warn that 'Datafile is almost full' maria_chk: MARIA file test2 -maria_chk: warning: Datafile is almost full, 65532 of 65534 used +maria_chk: warning: Datafile is almost full, 65516 of 65534 used MARIA-table 'test2' is usable but should be fixed -Commands Used count Errors Recover errors -open 1 0 0 -write 50 0 0 -update 5 0 0 -delete 50 0 0 -close 1 0 0 -extra 6 0 0 -Total 113 0 0 -Commands Used count Errors Recover errors -open 2 0 0 -write 100 0 0 -update 10 0 0 -delete 100 0 0 -close 2 0 0 -extra 12 0 0 -Total 226 0 0 - -real 0m0.994s -user 0m0.432s -sys 0m0.184s - -real 0m2.153s -user 0m1.196s -sys 0m0.228s - -real 0m1.483s -user 0m0.772s + +real 0m0.808s +user 0m0.584s +sys 0m0.212s + +real 0m0.780s +user 0m0.584s +sys 0m0.176s + +real 0m0.809s +user 0m0.616s sys 0m0.180s -real 0m1.992s -user 0m1.180s +real 0m1.356s +user 0m1.140s sys 0m0.188s -real 0m2.028s +real 0m0.783s +user 0m0.600s +sys 0m0.176s + +real 0m1.390s user 0m1.184s sys 0m0.152s -real 0m1.878s -user 0m1.028s -sys 0m0.136s +real 0m1.875s +user 0m1.632s +sys 0m0.244s + +real 0m1.313s +user 0m1.148s +sys 0m0.160s + +real 0m1.846s +user 0m1.644s +sys 0m0.188s + +real 0m1.875s +user 0m1.632s +sys 0m0.212s + +real 0m1.819s +user 0m1.672s +sys 0m0.124s + +real 0m2.117s +user 0m1.816s +sys 0m0.292s -real 0m1.980s -user 0m1.116s -sys 0m0.192s +real 0m1.871s +user 0m1.636s +sys 0m0.196s diff --git a/storage/maria/ma_unique.c b/storage/maria/ma_unique.c index b79c5558933..5d0133c8ac1 100644 --- a/storage/maria/ma_unique.c +++ b/storage/maria/ma_unique.c @@ -26,7 +26,7 @@ my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def, byte *record, MARIA_KEYDEF *key= &info->s->keyinfo[def->key]; byte *key_buff= info->lastkey2; DBUG_ENTER("_ma_check_unique"); - DBUG_PRINT("enter",("unique_hash: %lu", unique_hash)); + DBUG_PRINT("enter",("unique_hash: %lu", (ulong) unique_hash)); maria_unique_store(record+key->seg->start, unique_hash); _ma_make_key(info,def->key,key_buff,record,0); diff --git a/storage/maria/tablockman.c b/storage/maria/tablockman.c index d8dffa09a5e..810c6c12ea4 100644 --- a/storage/maria/tablockman.c +++ b/storage/maria/tablockman.c @@ -1,5 +1,5 @@ -#warning TODO - allocate everything from dynarrays !!! (benchmark) -#warning automatically place S instead of LS if possible +/* QQ: TODO - allocate everything from dynarrays !!! (benchmark) */ +/* QQ: automatically place S instead of LS if possible */ /* Copyright (C) 2006 MySQL AB This program is free software; you can redistribute it and/or modify @@ -219,7 +219,7 @@ static const enum lockman_getlock_result getlock_result[10][10]= */ struct st_table_lock { -#warning do we need upgraded_from ? + /* QQ: do we need upgraded_from ? */ struct st_table_lock *next_in_lo, *upgraded_from, *next, *prev; struct st_locked_table *table; uint16 loid; diff --git a/storage/maria/tablockman.h b/storage/maria/tablockman.h index 4498e7027b4..2c6fb6996a3 100644 --- a/storage/maria/tablockman.h +++ b/storage/maria/tablockman.h @@ -33,7 +33,7 @@ LSIX - Loose Shared + Intention eXclusive */ #ifndef _lockman_h -#warning TODO remove N-locks +/* QQ: TODO remove N-locks */ enum lock_type { N, S, X, IS, IX, SIX, LS, LX, SLX, LSIX, LOCK_TYPE_LAST }; enum lockman_getlock_result { NO_MEMORY_FOR_LOCK=1, DEADLOCK, LOCK_TIMEOUT, diff --git a/storage/maria/trnman.c b/storage/maria/trnman.c index f289f6fcc5b..37978e4ff76 100644 --- a/storage/maria/trnman.c +++ b/storage/maria/trnman.c @@ -351,8 +351,8 @@ void trnman_end_trn(TRN *trn, my_bool commit) those lists, and thus nobody may want to free them. Now we don't need a mutex to access free_me list */ + /* QQ: send them to the purge thread */ while (free_me) -#warning XXX send them to the purge thread { TRN *t= free_me; free_me= free_me->next; diff --git a/storage/maria/unittest/lockman2-t.c b/storage/maria/unittest/lockman2-t.c index 2a8090ab9ac..01af1a03d22 100644 --- a/storage/maria/unittest/lockman2-t.c +++ b/storage/maria/unittest/lockman2-t.c @@ -171,10 +171,12 @@ void run_test(const char *test, pthread_handler handler, int n, int m) static void reinit_tlo(TABLOCKMAN *lm, TABLE_LOCK_OWNER *lo) { +#ifdef NOT_USED_YET TABLE_LOCK_OWNER backup= *lo; +#endif tablockman_release_locks(lm, lo); - /* +#ifdef NOT_USED_YET pthread_mutex_destroy(lo->mutex); pthread_cond_destroy(lo->cond); bzero(lo, sizeof(*lo)); @@ -183,7 +185,8 @@ static void reinit_tlo(TABLOCKMAN *lm, TABLE_LOCK_OWNER *lo) lo->cond= backup.cond; lo->loid= backup.loid; pthread_mutex_init(lo->mutex, MY_MUTEX_INIT_FAST); - pthread_cond_init(lo->cond, 0);*/ + pthread_cond_init(lo->cond, 0); +#endif } pthread_mutex_t rt_mutex; @@ -191,8 +194,8 @@ int Nrows= 100; int Ntables= 10; int table_lock_ratio= 10; enum lock_type lock_array[6]= {S, X, LS, LX, IS, IX}; -char *lock2str[6]= {"S", "X", "LS", "LX", "IS", "IX"}; -char *res2str[]= { +const char *lock2str[6]= {"S", "X", "LS", "LX", "IS", "IX"}; +const char *res2str[]= { 0, "OUT OF MEMORY", "DEADLOCK", @@ -200,6 +203,7 @@ char *res2str[]= { "GOT THE LOCK", "GOT THE LOCK NEED TO LOCK A SUBRESOURCE", "GOT THE LOCK NEED TO INSTANT LOCK A SUBRESOURCE"}; + pthread_handler_t test_lockman(void *arg) { int m= (*(int *)arg); @@ -215,13 +219,16 @@ pthread_handler_t test_lockman(void *arg) for (x= ((int)(intptr)(&m)); m > 0; m--) { - x= (x*3628273133 + 1500450271) % 9576890767; /* three prime numbers */ + /* three prime numbers */ + x= (uint) ((x*LL(3628273133) + LL(1500450271)) % LL(9576890767)); row= x % Nrows + Ntables; table= row % Ntables; locklevel= (x/Nrows) & 3; if (table_lock_ratio && (x/Nrows/4) % table_lock_ratio == 0) - { /* table lock */ - res= tablockman_getlock(&tablockman, lo1, ltarray+table, lock_array[locklevel]); + { + /* table lock */ + res= tablockman_getlock(&tablockman, lo1, ltarray+table, + lock_array[locklevel]); DIAG(("loid %2d, table %d, lock %s, res %s", loid, table, lock2str[locklevel], res2str[res])); if (res < GOT_THE_LOCK) diff --git a/storage/maria/unittest/ma_control_file-t.c b/storage/maria/unittest/ma_control_file-t.c index beb86843dd3..49575378c78 100644 --- a/storage/maria/unittest/ma_control_file-t.c +++ b/storage/maria/unittest/ma_control_file-t.c @@ -42,7 +42,7 @@ char file_name[FN_REFLEN]; LSN expect_checkpoint_lsn; uint32 expect_logno; -static int delete_file(); +static int delete_file(myf my_flags); /* Those are test-specific wrappers around the module's API functions: after calling the module's API functions they perform checks on the result. @@ -91,7 +91,7 @@ int main(int argc,char *argv[]) get_options(argc,argv); diag("Deleting control file at startup, if there is an old one"); - RET_ERR_UNLESS(0 == delete_file()); /* if fails, can't continue */ + RET_ERR_UNLESS(0 == delete_file(0)); /* if fails, can't continue */ diag("Tests of normal conditions"); ok(0 == test_one_log(), "test of creating one log"); @@ -111,7 +111,7 @@ int main(int argc,char *argv[]) } -static int delete_file() +static int delete_file(myf my_flags) { RET_ERR_UNLESS(fn_format(file_name, CONTROL_FILE_BASE_NAME, maria_data_root, "", MYF(MY_WME)) != NullS); @@ -119,7 +119,7 @@ static int delete_file() Maybe file does not exist, ignore error. The error will however be printed on stderr. */ - my_delete(file_name, MYF(MY_WME)); + my_delete(file_name, my_flags); expect_checkpoint_lsn= CONTROL_FILE_IMPOSSIBLE_LSN; expect_logno= CONTROL_FILE_IMPOSSIBLE_FILENO; @@ -365,7 +365,7 @@ static int test_bad_size() int fd; /* A too short file */ - RET_ERR_UNLESS(delete_file() == 0); + RET_ERR_UNLESS(delete_file(MYF(MY_WME)) == 0); RET_ERR_UNLESS((fd= my_open(file_name, O_BINARY | O_RDWR | O_CREAT, MYF(MY_WME))) >= 0); @@ -378,7 +378,7 @@ static int test_bad_size() RET_ERR_UNLESS(my_close(fd, MYF(MY_WME)) == 0); /* Leave a correct control file */ - RET_ERR_UNLESS(delete_file() == 0); + RET_ERR_UNLESS(delete_file(MYF(MY_WME)) == 0); RET_ERR_UNLESS(create_or_open_file() == CONTROL_FILE_OK); RET_ERR_UNLESS(close_file() == 0); diff --git a/storage/maria/unittest/trnman-t.c b/storage/maria/unittest/trnman-t.c index 3c70d10c440..7d97794b685 100644 --- a/storage/maria/unittest/trnman-t.c +++ b/storage/maria/unittest/trnman-t.c @@ -35,7 +35,7 @@ int litmus; pthread_handler_t test_trnman(void *arg) { int m= (*(int *)arg); - uint x, y, i, j, n; + uint x, y, i, n; TRN *trn[MAX_ITER]; pthread_mutex_t mutexes[MAX_ITER]; pthread_cond_t conds[MAX_ITER]; @@ -48,7 +48,7 @@ pthread_handler_t test_trnman(void *arg) for (x= ((int)(intptr)(&m)); m > 0; ) { - y= x= (x*3628273133 + 1500450271) % 9576890767; /* three prime numbers */ + y= x= (x*LL(3628273133) + LL(1500450271)) % LL(9576890767); /* three prime numbers */ m-= n= x % MAX_ITER; for (i= 0; i < n; i++) { @@ -65,7 +65,6 @@ pthread_handler_t test_trnman(void *arg) trnman_end_trn(trn[i], y & 1); } } -end: for (i= 0; i < MAX_ITER; i++) { pthread_mutex_destroy(&mutexes[i]); diff --git a/storage/ndb/src/mgmapi/mgmapi.cpp b/storage/ndb/src/mgmapi/mgmapi.cpp index 614d0fea8e2..60201eac431 100644 --- a/storage/ndb/src/mgmapi/mgmapi.cpp +++ b/storage/ndb/src/mgmapi/mgmapi.cpp @@ -1274,13 +1274,13 @@ ndb_mgm_get_clusterlog_severity_filter(NdbMgmHandle handle, MGM_ARG(clusterlog_severity_names[5], Int, Mandatory, ""), MGM_ARG(clusterlog_severity_names[6], Int, Mandatory, ""), }; - CHECK_HANDLE(handle, NULL); - CHECK_CONNECTED(handle, NULL); + CHECK_HANDLE(handle, 0); + CHECK_CONNECTED(handle, 0); Properties args; const Properties *reply; reply = ndb_mgm_call(handle, getinfo_reply, "get info clusterlog", &args); - CHECK_REPLY(reply, NULL); + CHECK_REPLY(reply, 0); for(unsigned int i=0; i < severity_size; i++) { reply->get(clusterlog_severity_names[severity[i].category], &severity[i].value); @@ -1431,13 +1431,13 @@ ndb_mgm_get_clusterlog_loglevel(NdbMgmHandle handle, MGM_ARG(clusterlog_names[10], Int, Mandatory, ""), MGM_ARG(clusterlog_names[11], Int, Mandatory, ""), }; - CHECK_HANDLE(handle, NULL); - CHECK_CONNECTED(handle, NULL); + CHECK_HANDLE(handle, 0); + CHECK_CONNECTED(handle, 0); Properties args; const Properties *reply; reply = ndb_mgm_call(handle, getloglevel_reply, "get cluster loglevel", &args); - CHECK_REPLY(reply, NULL); + CHECK_REPLY(reply, 0); for(int i=0; i < loglevel_count; i++) { reply->get(clusterlog_names[loglevel[i].category], &loglevel[i].value); diff --git a/unittest/mysys/mf_pagecache_consist.c b/unittest/mysys/mf_pagecache_consist.c index d31c19cc746..fd824e27051 100755 --- a/unittest/mysys/mf_pagecache_consist.c +++ b/unittest/mysys/mf_pagecache_consist.c @@ -101,7 +101,7 @@ uint check_page(uchar *buff, ulong offset, int page_locked, int page_no, (page_locked ? "locked" : "unlocked"), end, num, tag); h= my_open("wrong_page", O_CREAT | O_TRUNC | O_RDWR, MYF(0)); - my_pwrite(h, buff, PAGE_SIZE, 0, MYF(0)); + my_pwrite(h, (byte*) buff, PAGE_SIZE, 0, MYF(0)); my_close(h, MYF(0)); goto err; } diff --git a/unittest/mysys/my_atomic-t.c b/unittest/mysys/my_atomic-t.c index 02e07acd67b..c16a2f118e5 100644 --- a/unittest/mysys/my_atomic-t.c +++ b/unittest/mysys/my_atomic-t.c @@ -252,11 +252,11 @@ void test_atomic(const char *test, pthread_handler handler, int n, int m) for (i= 0 ; i < n ; i++) pthread_join(threads[i], 0); now= my_getsystime()-now; -err: ok(a32 == 0, "tested %s in %g secs (%d)", test, ((double)now)/1e7, a32); my_free((void *)threads, MYF(0)); } + int main() { int err; |