DBD-MariaDB

 view release on metacpan or  search on metacpan

dbdimp.h  view on Meta::CPAN

/*
 *  DBD::MariaDB - DBI driver for the MariaDB and MySQL database
 *
 *  Copyright (c) 2005       Patrick Galbraith
 *  Copyright (c) 2003       Rudolf Lippan
 *  Copyright (c) 1997-2003  Jochen Wiedmann
 *
 *  Based on DBD::Oracle; DBD::Oracle is
 *
 *  Copyright (c) 1994,1995  Tim Bunce
 *
 *  You may distribute this under the terms of either the GNU General Public
 *  License or the Artistic License, as specified in the Perl README file.
 */

#define PERL_NO_GET_CONTEXT
/*
 *  Header files we use
 */

/*
 * On WIN32 windows.h and winsock.h need to be included before mysql.h
 * Otherwise SOCKET type which is needed for mysql.h is not defined
 * SO_UPDATE_CONNECT_CONTEXT is not defined in all MinGW versions.
 */
#ifdef _WIN32
#include <windows.h>
#include <winsock.h>
#ifndef SO_UPDATE_CONNECT_CONTEXT
#define SO_UPDATE_CONNECT_CONTEXT 0x7010
#endif
#endif

#include <mysql.h>  /* Comes with MySQL-devel */
#include <mysqld_error.h>  /* Comes MySQL */
#include <errmsg.h> /* Comes with MySQL-devel */

#ifndef MYSQL_VERSION_ID
#include <mysql_version.h> /* Comes with MySQL-devel */
#endif

#include <DBIXS.h>  /* installed by the DBI module */
#include <stdint.h> /* For uint32_t */


/*******************************************************************************
 * Standard MariaDB macros which are not defined in every MySQL/MariaDB client *
 *******************************************************************************/

#if !defined(MARIADB_BASE_VERSION) && defined(MARIADB_PACKAGE_VERSION)
#define MARIADB_BASE_VERSION
#endif

/* Macro is available in my_global.h which is not included or present in some versions of MariaDB */
#ifndef NOT_FIXED_DEC
#define NOT_FIXED_DEC 31
#endif

/* Macro is available in m_ctype.h which is not included in some versions of MySQL */
#ifndef MY_CS_PRIMARY
#define MY_CS_PRIMARY 32
#endif

/* Macro is available in mysql_com.h, but not defined in older MySQL versions */
#ifndef SERVER_STATUS_NO_BACKSLASH_ESCAPES
#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512
#endif

/* Macro is not defined in older MySQL versions */
#ifndef CR_NO_STMT_METADATA
#define CR_NO_STMT_METADATA 2052
#endif

/* Macro is not defined in some MariaDB versions */
#ifndef CR_NO_RESULT_SET
#define CR_NO_RESULT_SET 2053
#endif

/* Macro is not defined in older MySQL versions */
#ifndef CR_NOT_IMPLEMENTED
#define CR_NOT_IMPLEMENTED 2054
#endif

/* Macro is not defined in older MySQL versions */
#ifndef CR_STMT_CLOSED
#define CR_STMT_CLOSED 2056
#endif

/* Macro was added in MySQL 8.0.24 */
#ifndef ER_CLIENT_INTERACTION_TIMEOUT
#define ER_CLIENT_INTERACTION_TIMEOUT 4031
#endif


/********************************************************************
 * Standard Perl macros which are not defined in every Perl version *
 ********************************************************************/

#ifndef PERL_STATIC_INLINE
#define PERL_STATIC_INLINE static
#endif

#ifndef NOT_REACHED
#define NOT_REACHED assert(0)
#endif

#ifndef SVfARG
#define SVfARG(p) ((void*)(p))
#endif

#ifndef SSize_t_MAX
#define SSize_t_MAX (SSize_t)(~(Size_t)0 >> 1)
#endif

/* _set_osfhnd() is copied from Perl source file win32.h */
#ifdef _WIN32
typedef intptr_t ioinfo;
extern __declspec(dllimport) ioinfo* __pioinfo[];
#  define IOINFO_L2E 5
#  define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E)
#  define _ioinfo_size (_msize((void*)__pioinfo[0]) / IOINFO_ARRAY_ELTS)
#  define _pioinfo(i) ((intptr_t *) \
    (((Size_t)__pioinfo[(i) >> IOINFO_L2E])/* * to head of array ioinfo [] */\
     /* offset to the head of a particular ioinfo struct */ \
     + (((i) & (IOINFO_ARRAY_ELTS - 1)) * _ioinfo_size)) \
   )
#  define _osfhnd(i) (*(_pioinfo(i)))
#  define _set_osfhnd(fh, osfh) (void)(_osfhnd(fh) = (intptr_t)osfh)
#endif

/* PERL_UNUSED_ARG does not exist prior to perl 5.9.3 */
#ifndef PERL_UNUSED_ARG
#  if defined(lint) && defined(S_SPLINT_S) /* www.splint.org */
#    include <note.h>
#    define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
#  else
#    define PERL_UNUSED_ARG(x) ((void)x)
#  endif
#endif

/* assert_not_ROK is broken prior to perl 5.8.2 */
#if PERL_VERSION < 8 || (PERL_VERSION == 8 && PERL_SUBVERSION < 2)
#undef assert_not_ROK
#define assert_not_ROK(sv)
#endif

#ifndef SvPV_nomg_nolen
#define SvPV_nomg_nolen(sv) ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK ? SvPVX(sv) : sv_2pv_flags(sv, &PL_na, 0))
#endif



( run in 0.673 second using v1.01-cache-2.11-cpan-437f7b0c052 )