Skip to content

Commit

Permalink
changed plugin library types from SHARED to MODULE
Browse files Browse the repository at this point in the history
Fixed float/double/decimal converion for prepared statements:
  since _gcvt (Windows) and gcvt (*nix) deliver different results
  we use now dtoa.c from server package, which is licensed under
  LGPL.
  • Loading branch information
9EOR9 committed Mar 11, 2016
1 parent 826da74 commit 2f67911
Show file tree
Hide file tree
Showing 11 changed files with 2,906 additions and 93 deletions.
10 changes: 9 additions & 1 deletion include/ma_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ extern double my_atof(const char*);
#define LONGLONG_MAX ((long long) 0x7FFFFFFFFFFFFFFFLL)
#endif


#define INT_MIN64 (~0x7FFFFFFFFFFFFFFFLL)
#define INT_MAX64 0x7FFFFFFFFFFFFFFFLL
#define INT_MIN32 (~0x7FFFFFFFL)
Expand Down Expand Up @@ -576,7 +577,7 @@ extern double my_atof(const char*);
Max size that must be added to a so that we know Size to make
adressable obj.
*/
typedef long my_ptrdiff_t;
typedef long my_ptrdiff_t;
#define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1))
#define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double))
/* Size to make adressable obj. */
Expand Down Expand Up @@ -646,6 +647,13 @@ typedef long longlong;
#define longlong_defined
#endif

#ifndef HAVE_INT64
typedef longlong int64;
#endif
#ifndef HAVE_UINT64
typedef ulonglong uint64;
#endif

#ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
Expand Down
8 changes: 8 additions & 0 deletions include/ma_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@

#include <string.h>

typedef enum {
MY_GCVT_ARG_FLOAT,
MY_GCVT_ARG_DOUBLE
} my_gcvt_arg_type;

size_t ma_fcvt(double x, int precision, char *to, my_bool *error);
size_t ma_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
my_bool *error);
char *ma_ll2str(long long val,char *dst, int radix);

#endif
1 change: 1 addition & 0 deletions libmariadb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ mariadb_stmt.c
ma_loaddata.c
ma_stmt_codec.c
ma_string.c
ma_dtoa.c
${CMAKE_BINARY_DIR}/libmariadb/ma_client_plugin.c
ma_io.c
${SSL_SOURCES}
Expand Down
Loading

0 comments on commit 2f67911

Please sign in to comment.