Skip to content
Permalink
Browse files

MDEV-8450: PATCH] Wrong macro expansion in Query_cache::send_result_t…

…o_client()

Expression in macro protected by ()
  • Loading branch information...
Oleksandr Byelkin
Oleksandr Byelkin committed Sep 1, 2015
1 parent 9abf426 commit 0ce0b88080fd39f6841206b64d8723af9779e849
@@ -43,7 +43,7 @@ extern "C" {
#define MARIA_NAME_IEXT ".MAI"
#define MARIA_NAME_DEXT ".MAD"
/* Max extra space to use when sorting keys */
#define MARIA_MAX_TEMP_LENGTH 2*1024L*1024L*1024L
#define MARIA_MAX_TEMP_LENGTH (2*1024L*1024L*1024L)
/* Possible values for maria_block_size (must be power of 2) */
#define MARIA_KEY_BLOCK_LENGTH 8192 /* default key block length */
#define MARIA_MIN_KEY_BLOCK_LENGTH 1024 /* Min key block length */
@@ -50,7 +50,7 @@ extern ulong my_time_to_wait_for_lock;
#define ALARM_INIT
#define ALARM_END
#define ALARM_TEST (alarm_pos++ >= alarm_end_pos)
#define ALARM_REINIT alarm_end_pos+=MY_HOW_OFTEN_TO_WRITE
#define ALARM_REINIT (alarm_end_pos+=MY_HOW_OFTEN_TO_WRITE)
#endif /* HAVE_ALARM */

#ifdef __cplusplus
@@ -536,13 +536,13 @@ typedef ulong key_part_map;
#define SEARCH_NULL_ARE_EQUAL 32768 /* NULL in keys are equal */
#define SEARCH_NULL_ARE_NOT_EQUAL 65536 /* NULL in keys are not equal */
/* Use this when inserting a key in position order */
#define SEARCH_INSERT SEARCH_NULL_ARE_NOT_EQUAL*2
#define SEARCH_INSERT (SEARCH_NULL_ARE_NOT_EQUAL*2)
/* Only part of the key is specified while reading */
#define SEARCH_PART_KEY SEARCH_INSERT*2
#define SEARCH_PART_KEY (SEARCH_INSERT*2)
/* Used when user key (key 2) contains transaction id's */
#define SEARCH_USER_KEY_HAS_TRANSID SEARCH_PART_KEY*2
#define SEARCH_USER_KEY_HAS_TRANSID (SEARCH_PART_KEY*2)
/* Used when page key (key 1) contains transaction id's */
#define SEARCH_PAGE_KEY_HAS_TRANSID SEARCH_USER_KEY_HAS_TRANSID*2
#define SEARCH_PAGE_KEY_HAS_TRANSID (SEARCH_USER_KEY_HAS_TRANSID*2)

/* bits in opt_flag */
#define QUICK_USED 1
@@ -79,8 +79,8 @@ extern unsigned int mariadb_deinitialize_ssl;
extern unsigned int mysql_port;
extern char *mysql_unix_port;

#define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout on read */
#define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */
#define CLIENT_NET_READ_TIMEOUT (365*24*3600) /* Timeout on read */
#define CLIENT_NET_WRITE_TIMEOUT (365*24*3600) /* Timeout on write */

#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
@@ -295,7 +295,7 @@ struct sql_ex_info
to the slave. It is used to increase the thd(max_allowed) for both the
DUMP thread on the master and the SQL/IO thread on the slave.
*/
#define MAX_MAX_ALLOWED_PACKET 1024*1024*1024
#define MAX_MAX_ALLOWED_PACKET (1024*1024*1024)

/*
Event header offsets;
@@ -17,7 +17,7 @@
#define SQL_TABLE_MAINTENANCE_H

/* Must be able to hold ALTER TABLE t PARTITION BY ... KEY ALGORITHM = 1 ... */
#define SQL_ADMIN_MSG_TEXT_SIZE 128 * 1024
#define SQL_ADMIN_MSG_TEXT_SIZE (128 * 1024)

bool mysql_assign_to_keycache(THD* thd, TABLE_LIST* table_list,
LEX_STRING *key_cache_name);
@@ -142,7 +142,7 @@
*/
#define STACK_MIN_SIZE 16000 // Abort if less stack during eval.

#define STACK_MIN_SIZE_FOR_OPEN 1024*80
#define STACK_MIN_SIZE_FOR_OPEN (1024*80)
#define STACK_BUFF_ALLOC 352 ///< For stack overrun checks
#ifndef MYSQLD_NET_RETRY_COUNT
#define MYSQLD_NET_RETRY_COUNT 10 ///< Abort read after this many int.
@@ -238,7 +238,7 @@
#define DEFAULT_CONCURRENCY 10
#define DELAYED_LIMIT 100 /**< pause after xxx inserts */
#define DELAYED_QUEUE_SIZE 1000
#define DELAYED_WAIT_TIMEOUT 5*60 /**< Wait for delayed insert */
#define DELAYED_WAIT_TIMEOUT (5*60) /**< Wait for delayed insert */
#define MAX_CONNECT_ERRORS 100 ///< errors before disabling host

#define LONG_TIMEOUT ((ulong) 3600L*24L*365L)
@@ -1634,7 +1634,7 @@ int tp_get_idle_thread_count()
Delay in microseconds, after which "pool blocked" message is printed.
(30 sec == 30 Mio usec)
*/
#define BLOCK_MSG_DELAY 30*1000000
#define BLOCK_MSG_DELAY (30*1000000)

#define MAX_THREADS_REACHED_MSG \
"Threadpool could not create additional thread to handle queries, because the \
@@ -110,36 +110,36 @@
The flag means that we need to process tables only to get necessary data.
Views are not processed.
*/
#define OPEN_TABLE_ONLY OPEN_FRM_FILE_ONLY*2
#define OPEN_TABLE_ONLY (OPEN_FRM_FILE_ONLY*2)
/**
This flag is used in function get_all_tables() which fills
I_S tables with data which are retrieved from frm files and storage engine
The flag means that we need to process views only to get necessary data.
Tables are not processed.
*/
#define OPEN_VIEW_ONLY OPEN_TABLE_ONLY*2
#define OPEN_VIEW_ONLY (OPEN_TABLE_ONLY*2)
/**
This flag is used in function get_all_tables() which fills
I_S tables with data which are retrieved from frm files and storage engine.
The flag means that we need to open a view using
open_normal_and_derived_tables() function.
*/
#define OPEN_VIEW_FULL OPEN_VIEW_ONLY*2
#define OPEN_VIEW_FULL (OPEN_VIEW_ONLY*2)
/**
This flag is used in function get_all_tables() which fills
I_S tables with data which are retrieved from frm files and storage engine.
The flag means that I_S table uses optimization algorithm.
*/
#define OPTIMIZE_I_S_TABLE OPEN_VIEW_FULL*2
#define OPTIMIZE_I_S_TABLE (OPEN_VIEW_FULL*2)
/**
This flag is used to instruct tdc_open_view() to check metadata version.
*/
#define CHECK_METADATA_VERSION OPEN_TRIGGER_ONLY*2
#define CHECK_METADATA_VERSION (OPEN_TRIGGER_ONLY*2)

/*
The flag means that we need to process trigger files only.
*/
#define OPEN_TRIGGER_ONLY OPTIMIZE_I_S_TABLE*2
#define OPEN_TRIGGER_ONLY (OPTIMIZE_I_S_TABLE*2)

#define SC_INFO_LENGTH 4 /* Form format constant */
#define TE_INFO_LENGTH 3
@@ -33,7 +33,7 @@

#define ARCHIVE_ROW_HEADER_SIZE 4

#define BUFFER_LEN 1024 + ARCHIVE_ROW_HEADER_SIZE
#define BUFFER_LEN (1024 + ARCHIVE_ROW_HEADER_SIZE)

char test_string[BUFFER_LEN];

@@ -123,7 +123,7 @@ PTDB TDBMUL::Duplicate(PGLOBAL g)
bool TDBMUL::InitFileNames(PGLOBAL g)
{
#define PFNZ 4096
#define FNSZ _MAX_DRIVE+_MAX_DIR+_MAX_FNAME+_MAX_EXT
#define FNSZ (_MAX_DRIVE+_MAX_DIR+_MAX_FNAME+_MAX_EXT)
char *pfn[PFNZ];
char *filename;
int rc, n = 0;
@@ -34,7 +34,7 @@
*/
#define HA_FEDERATED_ERROR_WITH_REMOTE_SYSTEM 10000

#define FEDERATED_QUERY_BUFFER_SIZE STRING_BUFFER_USUAL_SIZE * 5
#define FEDERATED_QUERY_BUFFER_SIZE (STRING_BUFFER_USUAL_SIZE * 5)
#define FEDERATED_RECORDS_IN_RANGE 2
#define FEDERATED_MAX_KEY_LENGTH 3500 // Same as innodb

@@ -44,7 +44,7 @@
/* Number of extents reserved MARIA_BITMAP_BLOCKS to store head part */
#define ELEMENTS_RESERVED_FOR_MAIN_PART 4
/* This is just used to prealloc a dynamic array */
#define AVERAGE_BLOB_SIZE 1024L*1024L
#define AVERAGE_BLOB_SIZE (1024L*1024L)
/* Number of pages to store continuous blob parts */
#define BLOB_SEGMENT_MIN_SIZE 128

@@ -307,7 +307,7 @@ struct st_myisam_info
int rtree_recursion_depth;
};

#define USE_WHOLE_KEY HA_MAX_KEY_BUFF*2 /* Use whole key in _mi_search() */
#define USE_WHOLE_KEY (HA_MAX_KEY_BUFF*2) /* Use whole key in _mi_search() */
#define F_EXTRA_LCK -1
/* bits in opt_flag */
#define MEMMAP_USED 32
@@ -23,7 +23,7 @@

#define ROW_LEN 16
#define ROW16_LEN 8
#define MAX_BUF 64*1024
#define MAX_BUF (64*1024)

static struct charset_info_st all_charsets[512];

@@ -264,7 +264,7 @@ static const struct my_cs_file_section_st
}

#define MY_CS_CSDESCR_SIZE 64
#define MY_CS_TAILORING_SIZE 32*1024
#define MY_CS_TAILORING_SIZE (32*1024)
#define MY_CS_UCA_VERSION_SIZE 64
#define MY_CS_CONTEXT_SIZE 64

0 comments on commit 0ce0b88

Please sign in to comment.
You can’t perform that action at this time.