summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2005-02-10 18:01:06 +0200
committerbell@sanja.is.com.ua <>2005-02-10 18:01:06 +0200
commit9b1bf2da5a6be8dd2197b6b58056f74305aceaaf (patch)
tree828e47008d5e9d854ff445efdc1768f3619981f4 /include
parent471c8e6777fa682a055428a250a18983ac93682d (diff)
parent51296b5399d6dcdd246c72f8a9798761bac92b76 (diff)
downloadmariadb-git-9b1bf2da5a6be8dd2197b6b58056f74305aceaaf.tar.gz
merge
Diffstat (limited to 'include')
-rw-r--r--include/decimal.h9
-rw-r--r--include/ft_global.h2
-rw-r--r--include/my_global.h6
-rw-r--r--include/mysql.h11
-rw-r--r--include/mysql_com.h5
5 files changed, 29 insertions, 4 deletions
diff --git a/include/decimal.h b/include/decimal.h
index 4d1fbfddc01..1e0ee97c267 100644
--- a/include/decimal.h
+++ b/include/decimal.h
@@ -26,7 +26,9 @@ typedef struct st_decimal {
decimal_digit *buf;
} decimal;
-int decimal2string(decimal *from, char *to, int *to_len);
+int decimal2string(decimal *from, char *to, int *to_len,
+ int fixed_precision, int fixed_decimals,
+ char filler);
int string2decimal(char *from, decimal *to, char **end);
int string2decimal_fixed(char *from, decimal *to, char **end);
int decimal2ulonglong(decimal *from, ulonglong *to);
@@ -35,6 +37,7 @@ int decimal2longlong(decimal *from, longlong *to);
int longlong2decimal(longlong from, decimal *to);
int decimal2double(decimal *from, double *to);
int double2decimal(double from, decimal *to);
+void decimal_optimize_fraction(decimal *from);
int decimal2bin(decimal *from, char *to, int precision, int scale);
int bin2decimal(char *from, decimal *to, int precision, int scale);
@@ -50,6 +53,7 @@ int decimal_div(decimal *from1, decimal *from2, decimal *to, int scale_incr);
int decimal_mod(decimal *from1, decimal *from2, decimal *to);
int decimal_round(decimal *from, decimal *to, int new_scale, decimal_round_mode mode);
int decimal_is_zero(decimal *from);
+void max_decimal(int precision, int frac, decimal *to);
/* set a decimal to zero */
@@ -65,7 +69,8 @@ int decimal_is_zero(decimal *from);
of the decimal (including decimal dot, possible sign and \0)
*/
-#define decimal_string_size(dec) ((dec)->intg + (dec)->frac + ((dec)->frac > 0) + 2)
+#define decimal_string_size(dec) (((dec)->intg ? (dec)->intg : 1) + \
+ (dec)->frac + ((dec)->frac > 0) + 2)
/* negate a decimal */
#define decimal_neg(dec) do { (dec)->sign^=1; } while(0)
diff --git a/include/ft_global.h b/include/ft_global.h
index 94f6ad9ef51..c3f60d13a7a 100644
--- a/include/ft_global.h
+++ b/include/ft_global.h
@@ -62,7 +62,7 @@ void ft_free_stopwords(void);
#define FT_SORTED 2
#define FT_EXPAND 4 /* query expansion */
-FT_INFO *ft_init_search(uint,void *, uint, byte *, uint, byte *);
+FT_INFO *ft_init_search(uint,void *, uint, byte *, uint,CHARSET_INFO *, byte *);
my_bool ft_boolean_check_syntax_string(const byte *);
#ifdef __cplusplus
diff --git a/include/my_global.h b/include/my_global.h
index f27eb4733bd..f5cd8edeab9 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -135,7 +135,13 @@
#ifdef HAVE_UNIXWARE7_THREADS
#include <thread.h>
#else
+#if defined(HPUX10) || defined(HPUX11)
+C_MODE_START /* HPUX needs this, signal.h bug */
+#include <pthread.h>
+C_MODE_END
+#else
#include <pthread.h> /* AIX must have this included first */
+#endif
#endif /* HAVE_UNIXWARE7_THREADS */
#endif /* HAVE_mit_thread */
#if !defined(SCO) && !defined(_REENTRANT)
diff --git a/include/mysql.h b/include/mysql.h
index 58c314207c1..b87b865608e 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -337,6 +337,17 @@ typedef struct st_mysql_parameters
*/
int STDCALL mysql_server_init(int argc, char **argv, char **groups);
void STDCALL mysql_server_end(void);
+/*
+ mysql_server_init/end need to be called when using libmysqld or
+ libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so
+ you don't need to call it explicitely; but you need to call
+ mysql_server_end() to free memory). The names are a bit misleading
+ (mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general
+ names which suit well whether you're using libmysqld or libmysqlclient. We
+ intend to promote these aliases over the mysql_server* ones.
+*/
+#define mysql_library_init mysql_server_init
+#define mysql_library_end mysql_server_end
MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void);
diff --git a/include/mysql_com.h b/include/mysql_com.h
index 78d71bde1cf..3165ca4c4c3 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -216,6 +216,7 @@ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR,
MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR,
MYSQL_TYPE_BIT,
+ MYSQL_TYPE_NEWDECIMAL=246,
MYSQL_TYPE_ENUM=247,
MYSQL_TYPE_SET=248,
MYSQL_TYPE_TINY_BLOB=249,
@@ -231,6 +232,7 @@ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
/* For backward compatibility */
#define CLIENT_MULTI_QUERIES CLIENT_MULTI_STATEMENTS
#define FIELD_TYPE_DECIMAL MYSQL_TYPE_DECIMAL
+#define FIELD_TYPE_NEWDECIMAL MYSQL_TYPE_NEWDECIMAL
#define FIELD_TYPE_TINY MYSQL_TYPE_TINY
#define FIELD_TYPE_SHORT MYSQL_TYPE_SHORT
#define FIELD_TYPE_LONG MYSQL_TYPE_LONG
@@ -346,7 +348,8 @@ struct rand_struct {
/* The following is for user defined functions */
-enum Item_result {STRING_RESULT, REAL_RESULT, INT_RESULT, ROW_RESULT};
+enum Item_result {STRING_RESULT, REAL_RESULT, INT_RESULT, ROW_RESULT,
+ DECIMAL_RESULT};
typedef struct st_udf_args
{