mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
query_id and my_xid -> ulonglong
fix for binlog+autocommit+tclog comments, style fixes libmysqld/libmysqld.rc: Change mode to -rw-rw-r-- libmysqld/resource.h: Change mode to -rw-rw-r-- configure.in: check for getpagesize include/my_global.h: typo ? include/my_pthread.h: bug in thread_safe_decrement_and_test() mysql-test/r/bdb.result: results updated mysql-test/r/innodb.result: results updated mysql-test/r/mix_innodb_myisam_binlog.result: results updated mysql-test/r/rpl_relayrotate.result: results updated sql/ha_berkeley.cc: style fixes sql/ha_innodb.cc: fixes to follow innodb coding style sql/handler.cc: more comments. XA COMMIT ONE PHASE fix. sql/handler.h: my_xid -> ulonglong. comments sql/item_func.cc: DO RELEASE_LOCK("...") is no cache_stmt sql/log.cc: comments, better error messages sql/log_event.cc: even in autocommit mode we may need to cache_stmt xid is ulonglong sql/log_event.h: more comments. sql/mysql_priv.h: query_id is ulonglong sql/mysqld.cc: default value for --log-tc changed sql/share/errmsg.txt: better error messages sql/sql_class.h: cleanup, comments sql/sql_delete.cc: deleting from temporary tables is not always transactional sql/sql_insert.cc: insert into temporary table is not always transactional sql/sql_load.cc: load data into temp table is not always transactional sql/sql_parse.cc: comments. bad merge fixed. xa_state_names[] sql/sql_table.cc: create/drop temp table is not always transactional sql/sql_update.cc: update temp table is not always transactional
This commit is contained in:
@ -1247,26 +1247,11 @@ SQL_CRYPT *get_crypt_for_frm(void);
|
||||
|
||||
/* query_id */
|
||||
|
||||
typedef ulong query_id_t;
|
||||
typedef ulonglong query_id_t;
|
||||
extern query_id_t query_id;
|
||||
|
||||
/*
|
||||
increment query_id and return it.
|
||||
but be sure it's never a 0
|
||||
(2^32 at 1000 q/s rate will means an overflow every ~50 days.
|
||||
*/
|
||||
inline query_id_t next_query_id()
|
||||
{
|
||||
if (sizeof(query_id_t) <= 5) // assuming the compiler optimizes dead code away
|
||||
{
|
||||
query_id_t old_query_id=query_id;
|
||||
if (unlikely(++query_id == 0))
|
||||
query_id=1;
|
||||
return old_query_id;
|
||||
}
|
||||
else
|
||||
return query_id++;
|
||||
}
|
||||
/* increment query_id and return it. */
|
||||
inline query_id_t next_query_id() { return query_id++; }
|
||||
|
||||
/* Some inline functions for more speed */
|
||||
|
||||
|
Reference in New Issue
Block a user