Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
dbd-mysql for mariadb 10.2+

Test install of DBD-mysql 4.0.48 patched with fix for MariaDB 10.2+ compatibility

cd /svr-setup
wget https://github.com/perl5-dbi/DBD-mysql/archive/4_048.tar.gz
tar xvzf 4_048.tar.gz
cd DBD-mysql-4_048
# patch DBD-mysql 4.0.48 with master branch perl5-dbi commit to fix MariaDB 10.2+ compatibility
# https://github.com/perl5-dbi/DBD-mysql/commit/cf752cd10fdd5d8c59f9baff7de6ac651323430e.diff
wget -O mariadbfix.patch https://github.com/perl5-dbi/DBD-mysql/commit/cf752cd10fdd5d8c59f9baff7de6ac651323430e.diff
patch -p1 < mariadbfix.patch
perl Makefile.PL
make -j$(nproc)
make test
make install
perl Makefile.PL


PLEASE NOTE:

For 'make test' to run properly, you must ensure that the
database user 'root' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.

mysql> grant all privileges on test.* to 'root'@'localhost' identified by 's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.PL --testuser=username

I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/usr/include/mysql -I/usr/include/mysql/mysql
  embedded      (mysql_config) = 
  ldflags       (guessed     ) = 
  libs          (mysql_config) = -L/usr/lib64/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto
  mysql_config  (guessed     ) = mysql_config
  nocatchstderr (default     ) = 0
  nofoundrows   (default     ) = 0
  nossl         (default     ) = 0
  testdb        (default     ) = test
  testhost      (default     ) = 
  testpassword  (default     ) = 
  testport      (default     ) = 
  testsocket    (default     ) = 
  testuser      (guessed     ) = root

To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::mysql::INSTALL'.

Checking if libs are available for compiling...
Looks good.

Checking if your kit is complete...
Looks good
Using DBI 1.627 (for perl 5.016003 on x86_64-linux-thread-multi) installed in /usr/lib64/perl5/vendor_perl/auto/DBI/
Writing Makefile for DBD::mysql
Wide character in print at /usr/share/perl5/vendor_perl/ExtUtils/MakeMaker.pm line 1054.
make -j$(nproc)
gcc -c  -I/usr/lib64/perl5/vendor_perl/auto/DBI -I/usr/include/mysql -I/usr/include/mysql/mysql -DDBD_MYSQL_WITH_SSL -g  -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic   -DVERSION=\"4.048\" -DXS_VERSION=\"4.048\" -fPIC "-I/usr/lib64/perl5/CORE"   dbdimp.c
/usr/bin/perl -p -e "s/~DRIVER~/mysql/g" /usr/lib64/perl5/vendor_perl/auto/DBI/Driver.xst > mysql.xsi
gcc -c  -I/usr/lib64/perl5/vendor_perl/auto/DBI -I/usr/include/mysql -I/usr/include/mysql/mysql -DDBD_MYSQL_WITH_SSL -g  -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic   -DVERSION=\"4.048\" -DXS_VERSION=\"4.048\" -fPIC "-I/usr/lib64/perl5/CORE"   socket.c
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
/usr/bin/perl /usr/share/perl5/vendor_perl/ExtUtils/xsubpp  -typemap /usr/share/perl5/ExtUtils/typemap  mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs
chmod 644 blib/arch/auto/DBD/mysql/mysql.bs
Warning: duplicate function definition 'do' detected in mysql.xs, line 247
Warning: duplicate function definition 'rows' detected in mysql.xs, line 680
dbdimp.c: In function ‘mysql_dr_connect’:
dbdimp.c:1938:19: warning: unused variable ‘ssl_mode’ [-Wunused-variable]
      unsigned int ssl_mode;
                   ^
gcc -c  -I/usr/lib64/perl5/vendor_perl/auto/DBI -I/usr/include/mysql -I/usr/include/mysql/mysql -DDBD_MYSQL_WITH_SSL -g  -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic   -DVERSION=\"4.048\" -DXS_VERSION=\"4.048\" -fPIC "-I/usr/lib64/perl5/CORE"   mysql.c
dbdimp.c: In function ‘mysql_st_prepare’:
dbdimp.c:3202:24: warning: assignment from incompatible pointer type [enabled by default]
           bind->is_null=      (_Bool*) &(fbind->is_null);
                        ^
mysql.c: In function ‘XS_DBD__mysql__db__login’:
mysql.c:284:7: warning: variable ‘attribs’ set but not used [-Wunused-but-set-variable]
  SV * attribs;
       ^
rm -f blib/arch/auto/DBD/mysql/mysql.so
gcc  -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Wl,-z,relro  dbdimp.o mysql.o socket.o  -o blib/arch/auto/DBD/mysql/mysql.so         \
   -L/usr/lib64/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto        \
  
chmod 755 blib/arch/auto/DBD/mysql/mysql.so
Manifying blib/man3/DBD::mysql.3pm
Manifying blib/man3/DBD::mysql::INSTALL.3pm
Manifying blib/man3/Bundle::DBD::mysql.3pm
make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base.t .............................. 1/6 # Driver version is 4.048
t/00base.t .............................. ok   
t/01caching_sha2_prime.t ................ # DBI connect(';mysql_ssl=1;mysql_get_server_pubkey=1','root',...) failed: SSL connection error: SSL is required, but the server does not support it at t/01caching_sha2_prime.t line 21.
t/01caching_sha2_prime.t ................ skipped: no database connection
t/05dbcreate.t .......................... # DBI connect('','root',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/05dbcreate.t line 16.
t/05dbcreate.t .......................... skipped: no database connection
t/10connect.t ........................... # DBI connect('test','root',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/10connect.t line 14.
t/10connect.t ........................... skipped: no database connection
t/15reconnect.t ......................... skipped: no database connection
t/16dbi-get_info.t ...................... skipped: no database connection
t/20createdrop.t ........................ skipped: no database connection
t/25lockunlock.t ........................ skipped: no database connection
t/29warnings.t .......................... skipped: no database connection
t/30insertfetch.t ....................... skipped: no database connection
t/31insertid.t .......................... skipped: no database connection
t/32insert_error.t ...................... skipped: no database connection
t/35limit.t ............................. skipped: no database connection
t/35prepare.t ........................... skipped: no database connection
t/40bindparam.t ......................... skipped: no database connection
t/40bindparam2.t ........................ skipped: no database connection
t/40bit.t ............................... skipped: no database connection
t/40blobs.t ............................. skipped: no database connection
t/40catalog.t ........................... skipped: no database connection
t/40keyinfo.t ........................... skipped: no database connection
t/40listfields.t ........................ skipped: no database connection
t/40nulls.t ............................. skipped: no database connection
t/40nulls_prepare.t ..................... skipped: no database connection
t/40numrows.t ........................... skipped: no database connection
t/40server_prepare.t .................... skipped: no database connection
t/40server_prepare_crash.t .............. skipped: no database connection
t/40server_prepare_error.t .............. skipped: no database connection
t/40types.t ............................. skipped: no database connection
t/41bindparam.t ......................... skipped: no database connection
t/41blobs_prepare.t ..................... skipped: no database connection
t/41int_min_max.t ....................... skipped: no database connection
t/42bindparam.t ......................... skipped: no database connection
t/43count_params.t ...................... skipped: no database connection
t/50chopblanks.t ........................ skipped: no database connection
t/50commit.t ............................ skipped: no database connection
t/51bind_type_guessing.t ................ skipped: no database connection
t/52comment.t ........................... skipped: no database connection
t/53comment.t ........................... skipped: no database connection
t/55utf8.t .............................. skipped: no database connection
t/55utf8mb4.t ........................... skipped: no database connection
t/56connattr.t .......................... skipped: no database connection
t/57trackgtid.t ......................... skipped: no database connection
t/60leaks.t ............................. skipped: Skip $ENV{EXTENDED_TESTING} is not set
t/65segfault.t .......................... skipped: no database connection
t/65types.t ............................. skipped: no database connection
t/70takeimp.t ........................... skipped: no database connection
t/71impdata.t ........................... skipped: no database connection
t/75supported_sql.t ..................... skipped: no database connection
t/76multi_statement.t ................... skipped: no database connection
t/80procs.t ............................. skipped: no database connection
t/81procs.t ............................. skipped: no database connection
t/85init_command.t ...................... skipped: no database connection
t/86_bug_36972.t ........................ skipped: no database connection
t/87async.t ............................. skipped: no database connection
t/88async-multi-stmts.t ................. skipped: no database connection
t/89async-method-check.t ................ skipped: no database connection
t/91errcheck.t .......................... skipped: no database connection
t/92ssl_backronym_vulnerability.t ....... skipped: no database connection: DBI connect('test','root',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/lib.pl line 57.
t/92ssl_optional.t ...................... skipped: no database connection: DBI connect('test','root',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/lib.pl line 57.
t/92ssl_riddle_vulnerability.t .......... skipped: no database connection: DBI connect('test','root',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/lib.pl line 57.
t/99_bug_server_prepare_blob_null.t ..... skipped: no database connection
t/manifest.t ............................ skipped: these tests are for release testing
t/pod.t ................................. skipped: Test::Pod 1.00 required for testing POD
t/rt110983-valid-mysqlfd.t .............. skipped: no database connection
t/rt118977-zerofill.t ................... skipped: no database connection
t/rt25389-bin-case.t .................... skipped: no database connection
t/rt50304-column_info_parentheses.t ..... skipped: no database connection
t/rt61849-bind-param-buffer-overflow.t .. skipped: no database connection
t/rt75353-innodb-lock-timeout.t ......... skipped: no database connection
t/rt83494-quotes-comments.t ............. skipped: no database connection
t/rt85919-fetch-lost-connection.t ....... skipped: no database connection
t/rt86153-reconnect-fail-memory.t ....... skipped: $ENV{EXTENDED_TESTING} is not set
t/rt88006-bit-prepare.t ................. skipped: no database connection
t/rt91715.t ............................. skipped: no database connection
t/version.t ............................. ok   
All tests successful.
Files=75, Tests=9, 11 wallclock secs ( 0.24 usr  0.42 sys +  7.19 cusr  2.66 csys = 10.51 CPU)
Result: PASS
make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/local/lib64/perl5/auto/DBD/mysql/mysql.bs
Installing /usr/local/lib64/perl5/auto/DBD/mysql/mysql.so
Installing /usr/local/lib64/perl5/Bundle/DBD/mysql.pm
Installing /usr/local/lib64/perl5/DBD/mysql.pm
Installing /usr/local/lib64/perl5/DBD/mysql/INSTALL.pod
Installing /usr/local/lib64/perl5/DBD/mysql/GetInfo.pm
Installing /usr/local/share/man/man3/Bundle::DBD::mysql.3pm
Installing /usr/local/share/man/man3/DBD::mysql::INSTALL.3pm
Installing /usr/local/share/man/man3/DBD::mysql.3pm
Appending installation info to /usr/lib64/perl5/perllocal.pod
perl -MDBD::mysql -e 'print $DBD::mysql::VERSION'
4.048
mysqladmin ver
mysqladmin  Ver 9.1 Distrib 10.3.10-MariaDB, for Linux on x86_64
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Server version          10.3.10-MariaDB
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/lib/mysql/mysql.sock
Uptime:                 14 days 12 hours 10 min 16 sec

Threads: 7  Questions: 2380407  Slow queries: 0  Opens: 267  Flush tables: 1  Open tables: 222  Queries per second avg: 1.899
perl -V
Summary of my perl5 (revision 5 version 16 subversion 3) configuration:
   
  Platform:
    osname=linux, osvers=3.10.0-514.16.1.el7.x86_64, archname=x86_64-linux-thread-multi
    uname='linux c1bm.rdu2.centos.org 3.10.0-514.16.1.el7.x86_64 #1 smp wed apr 12 15:04:24 utc 2017 x86_64 x86_64 x86_64 gnulinux '
    config_args='-des -Doptimize=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -Dccdlflags=-Wl,--enable-new-dtags -Dlddlflags=-shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -Wl,-z,relro  -DDEBUGGING=-g -Dversion=5.16.3 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl5 -Dsitearch=/usr/local/lib64/perl5 -Dprivlib=/usr/share/perl5 -Dvendorlib=/usr/share/perl5/vendor_perl -Darchlib=/usr/lib64/perl5 -Dvendorarch=/usr/lib64/perl5/vendor_perl -Darchname=x86_64-linux-thread-multi -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Duseshrplib -Dusethreads -Duseithreads -Dusedtrace=/usr/bin/dtrace -Duselargefiles -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl=n -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto -Ud_endservent_r_proto -Ud_setservent_r_proto -Dscriptdir=/usr/bin -Dusesitecustomize'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.8.5 20150623 (Red Hat 4.8.5-16)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -fstack-protector'
    libpth=/usr/local/lib64 /lib64 /usr/lib64
    libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat
    perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.17'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Wl,-z,relro '


Characteristics of this binary (from libperl): 
  Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
                        PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT
                        PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL
                        USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
                        USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
                        USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
                        USE_REENTRANT_API USE_SITECUSTOMIZE
  Locally applied patches:
        Fedora Patch1: Removes date check, Fedora/RHEL specific
        Fedora Patch3: support for libdir64
        Fedora Patch4: use libresolv instead of libbind
        Fedora Patch5: USE_MM_LD_RUN_PATH
        Fedora Patch6: Skip hostname tests, due to builders not being network capable
        Fedora Patch7: Dont run one io test due to random builder failures
        Fedora Patch9: Fix find2perl to translate ? glob properly (RT#113054)
        Fedora Patch10: Fix broken atof (RT#109318)
        Fedora Patch13: Clear $@ before "do" I/O error (RT#113730)
        Fedora Patch14: Do not truncate syscall() return value to 32 bits (RT#113980)
        Fedora Patch15: Override the Pod::Simple::parse_file (CPANRT#77530)
        Fedora Patch16: Do not leak with attribute on my variable (RT#114764)
        Fedora Patch17: Allow operator after numeric keyword argument (RT#105924)
        Fedora Patch18: Extend stack in File::Glob::glob, (RT#114984)
        Fedora Patch19: Do not crash when vivifying $|
        Fedora Patch20: Fix misparsing of maketext strings (CVE-2012-6329)
        Fedora Patch21: Add NAME headings to CPAN modules (CPANRT#73396)
        Fedora Patch22: Fix leaking tied hashes (RT#107000) [1]
        Fedora Patch23: Fix leaking tied hashes (RT#107000) [2]
        Fedora Patch24: Fix leaking tied hashes (RT#107000) [3]
        Fedora Patch25: Fix dead lock in PerlIO after fork from thread (RT#106212)
        Fedora Patch26: Make regexp safe in a signal handler (RT#114878)
        Fedora Patch27: Update h2ph(1) documentation (RT#117647)
        Fedora Patch28: Update pod2html(1) documentation (RT#117623)
        Fedora Patch29: Document Math::BigInt::CalcEmu requires Math::BigInt (CPAN RT#85015)
        RHEL Patch30: Use stronger algorithm needed for FIPS in t/op/crypt.t (RT#121591)
        RHEL Patch31: Make *DBM_File desctructors thread-safe (RT#61912)
        RHEL Patch32: Use stronger algorithm needed for FIPS in t/op/taint.t (RT#123338)
        RHEL Patch33: Remove CPU-speed-sensitive test in Benchmark test
        RHEL Patch34: Make File::Glob work with threads again
        RHEL Patch35: Fix CRLF conversion in ASCII FTP upload (CPAN RT#41642)
        RHEL Patch36: Do not leak the temp utf8 copy of namepv (CPAN RT#123786)
        RHEL Patch37: Fix duplicating PerlIO::encoding when spawning threads (RT#31923)
  Built under linux
  Compiled at Aug  2 2017 17:45:03
  @INC:
    /usr/local/lib64/perl5
    /usr/local/share/perl5
    /usr/lib64/perl5/vendor_perl
    /usr/share/perl5/vendor_perl
    /usr/lib64/perl5
    /usr/share/perl5
    .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment