summaryrefslogtreecommitdiff
path: root/sql/sql_const.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-05-29 11:32:46 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-05-29 11:32:46 +0300
commit90a91936852368774559a3ef2660e63e1e6f50e3 (patch)
tree97004f253bea0db37606928b592ae3bc70fa6672 /sql/sql_const.h
parentfcb68ffe3dfb1c841852bd62a9aac9708888f4e9 (diff)
parent6eefeb6fea05ff17d010d173ef244a1d92078d71 (diff)
downloadmariadb-git-90a91936852368774559a3ef2660e63e1e6f50e3.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql/sql_const.h')
-rw-r--r--sql/sql_const.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/sql_const.h b/sql/sql_const.h
index b3412af31fe..06f9a6042ad 100644
--- a/sql/sql_const.h
+++ b/sql/sql_const.h
@@ -243,6 +243,14 @@
#define DISK_TEMPTABLE_LOOKUP_COST 1.0
#define SORT_INDEX_CMP_COST 0.02
+
+#define COST_MAX (DBL_MAX * (1.0 - DBL_EPSILON))
+
+#define COST_ADD(c,d) (COST_MAX - (d) > (c) ? (c) + (d) : COST_MAX)
+
+#define COST_MULT(c,f) (COST_MAX / (f) > (c) ? (c) * (f) : COST_MAX)
+
+
#define MY_CHARSET_BIN_MB_MAXLEN 1
/** Don't pack string keys shorter than this (if PACK_KEYS=1 isn't used). */