summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2015-03-11 15:15:43 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2015-03-11 15:15:43 +0100
commit3aa1a600bb3cc72dd30edd8f1c41b90e1157a2ed (patch)
tree1532a7ce239f156f9f91771e86a07ee404177e6c
parentbe73c7ee4415af4c1188689e1642a39512c2ecbd (diff)
parent52a1b5a8c23ebd068172c3c18a4f11c690fd1a2c (diff)
downloadmariadb-git-3aa1a600bb3cc72dd30edd8f1c41b90e1157a2ed.tar.gz
Merge branch '10.1' of github.com:MariaDB/server into 10.1
-rw-r--r--CMakeLists.txt8
-rw-r--r--cmake/check_compiler_flag.cmake1
-rw-r--r--sql/item_cmpfunc.h29
3 files changed, 17 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3ca49a9ee4b..48015fa29d0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -206,13 +206,7 @@ IF(SECURITY_HARDENED)
MY_CHECK_AND_SET_COMPILER_FLAG("-pie -fPIC")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wl,-z,relro,-z,now")
MY_CHECK_AND_SET_COMPILER_FLAG("-fstack-protector --param=ssp-buffer-size=4")
-
- # sometimes _FORTIFY_SOURCE is predefined
- INCLUDE(CheckSymbolExists)
- CHECK_SYMBOL_EXISTS(_FORTIFY_SOURCE "" HAVE_FORTIFY_SOURCE)
- IF(NOT HAVE_FORTIFY_SOURCE)
- ADD_DEFINITIONS(-D_FORTIFY_SOURCE=2)
- ENDIF()
+ MY_CHECK_AND_SET_COMPILER_FLAG("-D_FORTIFY_SOURCE=2" RELEASE RELWITHDEBINFO)
ENDIF()
OPTION(ENABLE_DEBUG_SYNC "Enable debug sync (debug builds only)" ON)
diff --git a/cmake/check_compiler_flag.cmake b/cmake/check_compiler_flag.cmake
index 25e4af23dd9..8eb6ed2176e 100644
--- a/cmake/check_compiler_flag.cmake
+++ b/cmake/check_compiler_flag.cmake
@@ -9,6 +9,7 @@ SET(fail_patterns
FAIL_REGEX "unrecognized .*option"
FAIL_REGEX "ignoring unknown option"
FAIL_REGEX "warning:.*ignored"
+ FAIL_REGEX "warning:.*redefined"
FAIL_REGEX "[Ww]arning: [Oo]ption"
)
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 65b2c6148d4..14b40699060 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -1412,16 +1412,25 @@ public:
};
/* Functions used by where clause */
+class Item_func_null_predicate :public Item_bool_func
+{
+public:
+ Item_func_null_predicate(Item *a) :Item_bool_func(a) { sargable= true; }
+ optimize_type select_optimize() const { return OPTIMIZE_NULL; }
+ CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
+ void fix_length_and_dec() { decimals=0; max_length=1; maybe_null=0; }
+};
+
-class Item_func_isnull :public Item_bool_func
+class Item_func_isnull :public Item_func_null_predicate
{
public:
- Item_func_isnull(Item *a) :Item_bool_func(a) { sargable= TRUE; }
+ Item_func_isnull(Item *a) :Item_func_null_predicate(a) {}
longlong val_int();
enum Functype functype() const { return ISNULL_FUNC; }
void fix_length_and_dec()
{
- decimals=0; max_length=1; maybe_null=0;
+ Item_func_null_predicate::fix_length_and_dec();
update_used_tables();
}
const char *func_name() const { return "isnull"; }
@@ -1441,9 +1450,7 @@ public:
}
}
table_map not_null_tables() const { return 0; }
- optimize_type select_optimize() const { return OPTIMIZE_NULL; }
Item *neg_transformer(THD *thd);
- CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
};
/* Functions used by HAVING for rewriting IN subquery */
@@ -1474,25 +1481,19 @@ public:
};
-class Item_func_isnotnull :public Item_bool_func
+class Item_func_isnotnull :public Item_func_null_predicate
{
bool abort_on_null;
public:
- Item_func_isnotnull(Item *a) :Item_bool_func(a), abort_on_null(0)
- { sargable= TRUE; }
+ Item_func_isnotnull(Item *a) :Item_func_null_predicate(a), abort_on_null(0)
+ { }
longlong val_int();
enum Functype functype() const { return ISNOTNULL_FUNC; }
- void fix_length_and_dec()
- {
- decimals=0; max_length=1; maybe_null=0;
- }
const char *func_name() const { return "isnotnull"; }
- optimize_type select_optimize() const { return OPTIMIZE_NULL; }
table_map not_null_tables() const
{ return abort_on_null ? not_null_tables_cache : 0; }
Item *neg_transformer(THD *thd);
virtual void print(String *str, enum_query_type query_type);
- CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
void top_level_item() { abort_on_null=1; }
};