Skip to content

Commit

Permalink
Updated MySQL headers to 8.0.16
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Degtyariov committed Feb 21, 2019
1 parent 414aa55 commit 893aab6
Show file tree
Hide file tree
Showing 226 changed files with 4,051 additions and 1,030 deletions.
1 change: 1 addition & 0 deletions MYODBC_MYSQL.h
Expand Up @@ -47,6 +47,7 @@
#include <mysql/service_mysql_alloc.h>
#include <m_ctype.h>
#include <my_io.h>
#include <thr_mutex.h>

#else

Expand Down
7 changes: 4 additions & 3 deletions include/mysql-8.0/decimal.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down Expand Up @@ -55,7 +55,8 @@ struct decimal_t {
};

#ifndef MYSQL_ABI_CHECK
int string2decimal(const char *from, decimal_t *to, char **end);
void widen_fraction(int new_frac, decimal_t *d);
int string2decimal(const char *from, decimal_t *to, const char **end);
int decimal2string(const decimal_t *from, char *to, int *to_len,
int fixed_precision, int fixed_decimals, char filler);
int decimal2ulonglong(decimal_t *from, ulonglong *to);
Expand All @@ -64,7 +65,7 @@ int decimal2longlong(decimal_t *from, longlong *to);
int longlong2decimal(longlong from, decimal_t *to);
int decimal2double(const decimal_t *from, double *to);
int double2decimal(double from, decimal_t *to);
int decimal_actual_fraction(decimal_t *from);
int decimal_actual_fraction(const decimal_t *from);
int decimal2bin(decimal_t *from, uchar *to, int precision, int scale);
int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale);

Expand Down
5 changes: 3 additions & 2 deletions include/mysql-8.0/errmsg.h
@@ -1,7 +1,7 @@
#ifndef ERRMSG_INCLUDED
#define ERRMSG_INCLUDED

/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down Expand Up @@ -123,7 +123,8 @@ extern const char *client_errors[]; /* Error messages */
#define CR_INSECURE_API_ERR 2062
#define CR_FILE_NAME_TOO_LONG 2063
#define CR_SSL_FIPS_MODE_ERR 2064
#define CR_ERROR_LAST /*Copy last error nr:*/ 2064
#define CR_COMPRESSION_NOT_SUPPORTED 2065
#define CR_ERROR_LAST /*Copy last error nr:*/ 2065
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */

/* Visual Studio requires '__inline' for C code */
Expand Down
95 changes: 95 additions & 0 deletions include/mysql-8.0/field_types.h
@@ -0,0 +1,95 @@
/* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have included with MySQL.
Without limiting anything contained in the foregoing, this file,
which is part of C Driver for MySQL (Connector/C), is also subject to the
Universal FOSS Exception, version 1.0, a copy of which can be found at
http://oss.oracle.com/licenses/universal-foss-exception.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License, version 2.0, for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */

/**
@file field_types.h
@brief This file contains the field type.
@note This file can be imported both from C and C++ code, so the
definitions have to be constructed to support this.
*/

#ifndef FIELD_TYPES_INCLUDED
#define FIELD_TYPES_INCLUDED

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/*
* Constants exported from this package.
*/

/**
Column types for MySQL
*/
enum enum_field_types
#if defined(__cplusplus) && __cplusplus > 201103L
// N2764: Forward enum declarations, added in C++11
: int
#endif /* __cplusplus */
{ MYSQL_TYPE_DECIMAL,
MYSQL_TYPE_TINY,
MYSQL_TYPE_SHORT,
MYSQL_TYPE_LONG,
MYSQL_TYPE_FLOAT,
MYSQL_TYPE_DOUBLE,
MYSQL_TYPE_NULL,
MYSQL_TYPE_TIMESTAMP,
MYSQL_TYPE_LONGLONG,
MYSQL_TYPE_INT24,
MYSQL_TYPE_DATE,
MYSQL_TYPE_TIME,
MYSQL_TYPE_DATETIME,
MYSQL_TYPE_YEAR,
MYSQL_TYPE_NEWDATE, /**< Internal to MySQL. Not used in protocol */
MYSQL_TYPE_VARCHAR,
MYSQL_TYPE_BIT,
MYSQL_TYPE_TIMESTAMP2,
MYSQL_TYPE_DATETIME2, /**< Internal to MySQL. Not used in protocol */
MYSQL_TYPE_TIME2, /**< Internal to MySQL. Not used in protocol */
MYSQL_TYPE_JSON = 245,
MYSQL_TYPE_NEWDECIMAL = 246,
MYSQL_TYPE_ENUM = 247,
MYSQL_TYPE_SET = 248,
MYSQL_TYPE_TINY_BLOB = 249,
MYSQL_TYPE_MEDIUM_BLOB = 250,
MYSQL_TYPE_LONG_BLOB = 251,
MYSQL_TYPE_BLOB = 252,
MYSQL_TYPE_VAR_STRING = 253,
MYSQL_TYPE_STRING = 254,
MYSQL_TYPE_GEOMETRY = 255 };

#ifdef __cplusplus
} // extern "C"
#else
typedef enum enum_field_types enum_field_types;
#endif /* __cplusplus */

#endif /* FIELD_TYPES_INCLUDED */
69 changes: 27 additions & 42 deletions include/mysql-8.0/m_ctype.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down Expand Up @@ -28,12 +28,12 @@
#ifndef _m_ctype_h
#define _m_ctype_h

#include <stdarg.h>
#ifndef __cplusplus
#include <stdbool.h>
#endif
#include <stddef.h>
#include <sys/types.h>

#include "my_byteorder.h"
#include "my_compiler.h"
#include "my_inttypes.h"
#include "my_loglevel.h"
Expand All @@ -58,24 +58,10 @@ typedef ulong my_wc_t;

#define MY_CS_REPLACEMENT_CHARACTER 0xFFFD

/*
On i386 we store Unicode->CS conversion tables for
some character sets using Big-endian order,
to copy two bytes at onces.
This gives some performance improvement.
*/
#if defined(__i386__) || defined(__x86_64__)
#define MB2(x) (((x) >> 8) + (((x)&0xFF) << 8))
static inline void MY_PUT_MB2(unsigned char *s, uint16 code) {
int2store(s, code);
}
#else
#define MB2(x) (x)
static inline void MY_PUT_MB2(unsigned char *s, uint16 code) {
s[0] = code >> 8;
s[1] = code & 0xFF;
}
#endif

typedef struct MY_UNICASE_CHARACTER {
uint32 toupper;
Expand Down Expand Up @@ -170,13 +156,13 @@ typedef struct CHARSET_INFO CHARSET_INFO;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *system_charset_info;

typedef struct MY_CHARSET_LOADER {
char error[192];
uint errcode;
char errarg[192];
void *(*once_alloc)(size_t);
void *(*mem_malloc)(size_t);
void *(*mem_realloc)(void *, size_t);
void (*mem_free)(void *);
void (*reporter)(enum loglevel, const char *format, ...)
MY_ATTRIBUTE((format(printf, 2, 3)));
void (*reporter)(enum loglevel, uint errcode, ...);
int (*add_collation)(CHARSET_INFO *cs);
} MY_CHARSET_LOADER;

Expand Down Expand Up @@ -267,7 +253,7 @@ typedef struct MY_COLLATION_HANDLER {
nr2 holds extra state between invocations.
*/
void (*hash_sort)(const CHARSET_INFO *cs, const uchar *key, size_t len,
ulong *nr1, ulong *nr2);
uint64 *nr1, uint64 *nr2);
bool (*propagate)(const CHARSET_INFO *cs, const uchar *str, size_t len);
} MY_COLLATION_HANDLER;

Expand Down Expand Up @@ -347,20 +333,20 @@ typedef struct MY_CHARSET_HANDLER {

/* String-to-number conversion routines */
long (*strntol)(const CHARSET_INFO *, const char *s, size_t l, int base,
char **e, int *err);
const char **e, int *err);
ulong (*strntoul)(const CHARSET_INFO *, const char *s, size_t l, int base,
char **e, int *err);
const char **e, int *err);
longlong (*strntoll)(const CHARSET_INFO *, const char *s, size_t l, int base,
char **e, int *err);
const char **e, int *err);
ulonglong (*strntoull)(const CHARSET_INFO *, const char *s, size_t l,
int base, char **e, int *err);
double (*strntod)(const CHARSET_INFO *, char *s, size_t l, char **e,
int base, const char **e, int *err);
double (*strntod)(const CHARSET_INFO *, char *s, size_t l, const char **e,
int *err);
longlong (*strtoll10)(const CHARSET_INFO *cs, const char *nptr, char **endptr,
int *error);
longlong (*strtoll10)(const CHARSET_INFO *cs, const char *nptr,
const char **endptr, int *error);
ulonglong (*strntoull10rnd)(const CHARSET_INFO *cs, const char *str,
size_t length, int unsigned_fl, char **endptr,
int *error);
size_t length, int unsigned_fl,
const char **endptr, int *error);
size_t (*scan)(const CHARSET_INFO *, const char *b, const char *e, int sq);
} MY_CHARSET_HANDLER;

Expand Down Expand Up @@ -453,7 +439,7 @@ extern int my_strnncollsp_simple(const CHARSET_INFO *, const uchar *, size_t,
const uchar *, size_t);

extern void my_hash_sort_simple(const CHARSET_INFO *cs, const uchar *key,
size_t len, ulong *nr1, ulong *nr2);
size_t len, uint64 *nr1, uint64 *nr2);

extern size_t my_lengthsp_8bit(const CHARSET_INFO *cs, const char *ptr,
size_t length);
Expand Down Expand Up @@ -488,28 +474,28 @@ size_t my_snprintf_8bit(const CHARSET_INFO *, char *to, size_t n,
MY_ATTRIBUTE((format(printf, 4, 5)));

long my_strntol_8bit(const CHARSET_INFO *, const char *s, size_t l, int base,
char **e, int *err);
const char **e, int *err);
ulong my_strntoul_8bit(const CHARSET_INFO *, const char *s, size_t l, int base,
char **e, int *err);
const char **e, int *err);
longlong my_strntoll_8bit(const CHARSET_INFO *, const char *s, size_t l,
int base, char **e, int *err);
int base, const char **e, int *err);
ulonglong my_strntoull_8bit(const CHARSET_INFO *, const char *s, size_t l,
int base, char **e, int *err);
double my_strntod_8bit(const CHARSET_INFO *, char *s, size_t l, char **e,
int base, const char **e, int *err);
double my_strntod_8bit(const CHARSET_INFO *, char *s, size_t l, const char **e,
int *err);
size_t my_long10_to_str_8bit(const CHARSET_INFO *, char *to, size_t l,
int radix, long int val);
size_t my_longlong10_to_str_8bit(const CHARSET_INFO *, char *to, size_t l,
int radix, longlong val);

longlong my_strtoll10_8bit(const CHARSET_INFO *cs, const char *nptr,
char **endptr, int *error);
const char **endptr, int *error);
longlong my_strtoll10_ucs2(const CHARSET_INFO *cs, const char *nptr,
char **endptr, int *error);

ulonglong my_strntoull10rnd_8bit(const CHARSET_INFO *cs, const char *str,
size_t length, int unsigned_fl, char **endptr,
int *error);
size_t length, int unsigned_fl,
const char **endptr, int *error);
ulonglong my_strntoull10rnd_ucs2(const CHARSET_INFO *cs, const char *str,
size_t length, int unsigned_fl, char **endptr,
int *error);
Expand Down Expand Up @@ -596,7 +582,8 @@ int my_strcasecmp_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *s, const char *t);

void my_hash_sort_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *key, size_t len, ulong *nr1, ulong *nr2);
const uchar *key, size_t len, uint64 *nr1,
uint64 *nr2);

size_t my_strnxfrm_mb(const CHARSET_INFO *, uchar *dst, size_t dstlen,
uint nweights, const uchar *src, size_t srclen,
Expand All @@ -619,8 +606,6 @@ int my_wildcmp_unicode(const CHARSET_INFO *cs, const char *str,

extern bool my_parse_charset_xml(MY_CHARSET_LOADER *loader, const char *buf,
size_t buflen);
extern char *my_strchr(const CHARSET_INFO *cs, const char *str, const char *end,
char c);
extern size_t my_strcspn(const CHARSET_INFO *cs, const char *str,
const char *end, const char *reject,
size_t reject_length);
Expand Down

0 comments on commit 893aab6

Please sign in to comment.