summaryrefslogtreecommitdiff
path: root/storage/maria/ma_loghandler_lsn.h
diff options
context:
space:
mode:
authorunknown <jani@a88-113-38-195.elisa-laajakaista.fi>2007-07-04 12:20:53 +0300
committerunknown <jani@a88-113-38-195.elisa-laajakaista.fi>2007-07-04 12:20:53 +0300
commit8ba21c616e0503b05fa936523b44953eb403a844 (patch)
treeae7500f44289b2ba848d51b85fa7df3577248b18 /storage/maria/ma_loghandler_lsn.h
parent631ecaabea7336a8f28367c0d1c291f0433f7e88 (diff)
parenta898a7b63e65b46da82225ab8823897963dcbb3a (diff)
downloadmariadb-git-8ba21c616e0503b05fa936523b44953eb403a844.tar.gz
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-maria
into a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-maria.prod BitKeeper/etc/ignore: auto-union include/maria.h: Auto merged include/my_base.h: Auto merged mysql-test/include/ps_conv.inc: Auto merged mysql-test/r/ps_2myisam.result: Auto merged mysql-test/r/ps_3innodb.result: Auto merged mysql-test/r/ps_4heap.result: Auto merged mysql-test/r/ps_5merge.result: Auto merged mysql-test/r/ps_7ndb.result: Auto merged mysys/Makefile.am: Auto merged mysys/mf_iocache.c: Auto merged mysys/mf_tempfile.c: Auto merged mysys/my_error.c: Auto merged mysys/my_init.c: Auto merged mysys/my_open.c: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/lex.h: Auto merged sql/sql_show.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged storage/maria/ha_maria.cc: Auto merged storage/maria/ha_maria.h: Auto merged storage/maria/ma_bitmap.c: Auto merged storage/maria/ma_blockrec.h: Auto merged storage/maria/ma_create.c: Auto merged storage/maria/ma_dynrec.c: Auto merged storage/maria/ma_loghandler.h: Auto merged storage/maria/ma_loghandler_lsn.h: Auto merged storage/maria/ma_open.c: Auto merged storage/maria/ma_pagecache.c: Auto merged storage/maria/ma_pagecache.h: Auto merged storage/maria/ma_test1.c: Auto merged storage/maria/ma_test2.c: Auto merged storage/maria/ma_update.c: Auto merged storage/maria/maria_chk.c: Auto merged storage/maria/unittest/ma_test_loghandler-t.c: Auto merged storage/maria/unittest/ma_test_loghandler_multigroup-t.c: Auto merged storage/maria/unittest/ma_test_loghandler_multithread-t.c: Auto merged storage/maria/unittest/ma_test_loghandler_pagecache-t.c: Auto merged storage/myisam/ft_stopwords.c: Auto merged storage/myisam/mi_close.c: Auto merged support-files/compiler_warnings.supp: Auto merged mysys/mf_keycache.c: Pulled from mysql-maria tree, manual merge. mysys/my_handler.c: Pulled from mysql-maria tree, manual merge. mysys/my_symlink2.c: Pulled from mysql-maria tree, manual merge. sql/mysqld.cc: Pulled from mysql-maria tree, manual merge. sql/sql_table.cc: Pulled from mysql-maria tree, manual merge. storage/maria/ma_blockrec.c: Pulled from mysql-maria tree, manual merge. storage/maria/ma_check.c: Pulled from mysql-maria tree, manual merge. storage/maria/ma_close.c: Pulled from mysql-maria tree, manual merge. storage/maria/ma_loghandler.c: Pulled from mysql-maria tree, manual merge. storage/maria/maria_def.h: Pulled from mysql-maria tree, manual merge.
Diffstat (limited to 'storage/maria/ma_loghandler_lsn.h')
-rw-r--r--storage/maria/ma_loghandler_lsn.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/storage/maria/ma_loghandler_lsn.h b/storage/maria/ma_loghandler_lsn.h
index 0c02fe2c489..387fe2763d5 100644
--- a/storage/maria/ma_loghandler_lsn.h
+++ b/storage/maria/ma_loghandler_lsn.h
@@ -1,3 +1,18 @@
+/* Copyright (C) 2007 MySQL AB & Sanja Belkin
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
#ifndef _ma_loghandler_lsn_h
#define _ma_loghandler_lsn_h
@@ -24,16 +39,18 @@ typedef TRANSLOG_ADDRESS LSN;
#define LSN_FILE_NO(L) ((L) >> 32)
/* Gets raw file number part of a LSN/log address */
-#define LSN_FINE_NO_PART(L) ((L) & ((int64)0xFFFFFF00000000LL))
+#define LSN_FILE_NO_PART(L) ((L) & ((int64)0xFFFFFF00000000LL))
/* Gets record offset of a LSN/log address */
#define LSN_OFFSET(L) ((L) & 0xFFFFFFFFL)
/* Makes lsn/log address from file number and record offset */
-#define MAKE_LSN(F,S) ((((uint64)(F)) << 32) | (S))
+#define MAKE_LSN(F,S) ((LSN) ((((uint64)(F)) << 32) | (S)))
/* checks LSN */
-#define LSN_VALID(L) DBUG_ASSERT((L) >= 0 && (L) < (uint64)0xFFFFFFFFFFFFFFLL)
+#define LSN_VALID(L) \
+ ((LSN_FILE_NO_PART(L) != FILENO_IMPOSSIBLE) && \
+ (LSN_OFFSET(L) != LOG_OFFSET_IMPOSSIBLE))
/* size of stored LSN on a disk, don't change it! */
#define LSN_STORE_SIZE 7
@@ -51,7 +68,7 @@ typedef TRANSLOG_ADDRESS LSN;
/* what we need to add to LSN to increase it on one file */
#define LSN_ONE_FILE ((int64)0x100000000LL)
-#define LSN_REPLACE_OFFSET(L, S) (LSN_FINE_NO_PART(L) | (S))
+#define LSN_REPLACE_OFFSET(L, S) (LSN_FILE_NO_PART(L) | (S))
/*
an 8-byte type whose most significant uchar is used for "flags"; 7
@@ -61,4 +78,7 @@ typedef LSN LSN_WITH_FLAGS;
#define LSN_WITH_FLAGS_TO_LSN(x) (x & ULL(0x00FFFFFFFFFFFFFF))
#define LSN_WITH_FLAGS_TO_FLAGS(x) (x & ULL(0xFF00000000000000))
+#define FILENO_IMPOSSIBLE 0 /**< log file's numbering starts at 1 */
+#define LOG_OFFSET_IMPOSSIBLE 0 /**< log always has a header */
+#define LSN_IMPOSSIBLE 0
#endif