Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devel::CheckLib failing on valid config. #109

Closed
toddr opened this issue Mar 16, 2017 · 13 comments
Closed

Devel::CheckLib failing on valid config. #109

toddr opened this issue Mar 16, 2017 · 13 comments

Comments

@toddr
Copy link

toddr commented Mar 16, 2017

Previously working and bisected to the introduction of Devel::CheckLib in 9eda4cc

I'm using the mariadb-native-client modules for linking from mysql.so.

perl Makefile.PL INSTALLDIRS=vendor --mysql_config=/usr/local/cpanel/3rdparty/bin/mariadb_config

When I run, I get:

/usr/local/cpanel/3rdparty/perl/524/bin/perl Makefile.PL INSTALLDIRS=vendor --mysql_config=/usr/local/cpanel/3rdparty/bin/mariadb_config --testuser=root --testsocket=/var/lib/mysql/mysql.sock
/usr/local/cpanel/3rdparty/bin/mariadb_config: unrecognized option '--embedded'
I will use the following settings for compiling and testing:

  cflags        (mysql_config ) = -I/usr/local/cpanel/3rdparty/include/mariadb -Wunused -Wno-uninitialized
  embedded      (guessed      ) = 
  ldflags       (guessed      ) = 
  libs          (mysql_config ) = -L/usr/local/cpanel/3rdparty/lib64/mariadb -lmariadb -lpthread -lssl -ldl -lm
  mysql_config  (User's choice) = /usr/local/cpanel/3rdparty/bin/mariadb_config
  nocatchstderr (default      ) = 0
  nofoundrows   (default      ) = 0
  nossl         (default      ) = 0
  testdb        (default      ) = test
  testhost      (default      ) = 
  testpassword  (default      ) = 
  testport      (default      ) = 
  testsocket    (User's choice) = /var/lib/mysql/mysql.sock
  testuser      (User's choice) = root

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

Checking if libs are available for compiling...
/home/rpmbuild/rpm-build/BUILD/DBD-mysql-4.042/assertlibLotOK4qE: error while loading shared libraries: libmariadb.so.1: cannot open shared object file: No such file or directory
wrong result: 'mariadb'
@toddr
Copy link
Author

toddr commented Mar 16, 2017

Patching out Devel::CheckLib works for me. I suspect whatever is processing --mysql_config isn't making it in to the check? I'll investigate.

@pali
Copy link
Member

pali commented Mar 16, 2017

I'm using the mariadb-native-client modules for linking from mysql.so.

Which version? Some versions of MariaDB are known to be broken, see reported bug: https://jira.mariadb.org/browse/MDEV-12056

libs (mysql_config ) = -L/usr/local/cpanel/3rdparty/lib64/mariadb -lmariadb -lpthread -lssl -ldl -lm
/home/rpmbuild/rpm-build/BUILD/DBD-mysql-4.042/assertlibLotOK4qE: error while loading shared libraries: libmariadb.so.1: cannot open shared object file: No such file or directory

Which means that library libmariadb.so.1 expanded from param -lmariadb is not available in system lib directories (/lib /usr/lib/ ...) and also not in /usr/local/cpanel/3rdparty/lib64/mariadb specified by your mysql_config script /usr/local/cpanel/3rdparty/bin/mariadb_config.

So recheck where you have your libmariadb.so stored, if it is correct symlink and if script supplied correct path...

@toddr
Copy link
Author

toddr commented Mar 16, 2017

$>ls -ld /usr/local/cpanel/3rdparty/lib64/mariadb/libmariadb.so.1
-rwxr-xr-x 1 root root 1269985 Nov 20  2015 /usr/local/cpanel/3rdparty/lib64/mariadb/libmariadb.so.1

@pali
Copy link
Member

pali commented Mar 16, 2017

Please add debug => 1 option into assert_lib() call in Makefile.PL. It should provide verbose debug output.

@toddr
Copy link
Author

toddr commented Mar 17, 2017

I think it's compiling but then it's an rpath issue when it runs the test binary, right?

perl Makefile.PL INSTALLDIRS=vendor --mysql_config=/usr/local/cpanel/3rdparty/bin/mariadb_config --testuser=root --testsocket=/var/lib/mysql/mysql.sock
/usr/local/cpanel/3rdparty/bin/mariadb_config: unrecognized option '--embedded'
I will use the following settings for compiling and testing:

  cflags        (mysql_config ) = -I/usr/local/cpanel/3rdparty/include/mariadb -Wunused -Wno-uninitialized
  embedded      (guessed      ) = 
  ldflags       (guessed      ) = 
  libs          (mysql_config ) = -L/usr/local/cpanel/3rdparty/lib64/mariadb -lmariadb -lpthread -lssl -ldl -lm
  mysql_config  (User's choice) = /usr/local/cpanel/3rdparty/bin/mariadb_config
  nocatchstderr (default      ) = 0
  nofoundrows   (default      ) = 0
  nossl         (default      ) = 0
  testdb        (default      ) = test
  testhost      (default      ) = 
  testpassword  (default      ) = 
  testport      (default      ) = 
  testsocket    (User's choice) = /var/lib/mysql/mysql.sock
  testuser      (User's choice) = root

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

Checking if libs are available for compiling...
# Compiler seems to be /usr/bin/gcc
# /usr/bin/gcc -DPERL_DISABLE_PMC -fPIC -DPIC -I/usr/local/cpanel/3rdparty/perl/524/include -L/usr/local/cpanel/3rdparty/perl/524/lib64 -I/usr/local/cpanel/3rdparty/include -L/usr/local/cpanel/3rdparty/lib64 -m64 -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -Wl,-rpath -Wl,/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/lib64 -L/lib64 -lgdbm -fstack-protector-strong -L/usr/local/lib assertlibwuDdalOF.c -o assertlib1EVZDSxX -L/usr/local/cpanel/3rdparty/lib64/mariadb -lmariadb
/home/rpmbuild/rpm-build/BUILD/DBD-mysql-4.042/assertlib1EVZDSxX: error while loading shared libraries: libmariadb.so.1: cannot open shared object file: No such file or directory
# /usr/bin/gcc -DPERL_DISABLE_PMC -fPIC -DPIC -I/usr/local/cpanel/3rdparty/perl/524/include -L/usr/local/cpanel/3rdparty/perl/524/lib64 -I/usr/local/cpanel/3rdparty/include -L/usr/local/cpanel/3rdparty/lib64 -m64 -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -Wl,-rpath -Wl,/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/lib64 -L/lib64 -lgdbm -fstack-protector-strong -L/usr/local/lib assertlibwuDdalOF.c -o assertlibwTXP7XuF -L/usr/local/cpanel/3rdparty/lib64/mariadb -lpthread
# /usr/bin/gcc -DPERL_DISABLE_PMC -fPIC -DPIC -I/usr/local/cpanel/3rdparty/perl/524/include -L/usr/local/cpanel/3rdparty/perl/524/lib64 -I/usr/local/cpanel/3rdparty/include -L/usr/local/cpanel/3rdparty/lib64 -m64 -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -Wl,-rpath -Wl,/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/lib64 -L/lib64 -lgdbm -fstack-protector-strong -L/usr/local/lib assertlibwuDdalOF.c -o assertlibJNiLZYZS -L/usr/local/cpanel/3rdparty/lib64/mariadb -lssl
# /usr/bin/gcc -DPERL_DISABLE_PMC -fPIC -DPIC -I/usr/local/cpanel/3rdparty/perl/524/include -L/usr/local/cpanel/3rdparty/perl/524/lib64 -I/usr/local/cpanel/3rdparty/include -L/usr/local/cpanel/3rdparty/lib64 -m64 -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -Wl,-rpath -Wl,/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/lib64 -L/lib64 -lgdbm -fstack-protector-strong -L/usr/local/lib assertlibwuDdalOF.c -o assertlibDSKURBCW -L/usr/local/cpanel/3rdparty/lib64/mariadb -ldl
# /usr/bin/gcc -DPERL_DISABLE_PMC -fPIC -DPIC -I/usr/local/cpanel/3rdparty/perl/524/include -L/usr/local/cpanel/3rdparty/perl/524/lib64 -I/usr/local/cpanel/3rdparty/include -L/usr/local/cpanel/3rdparty/lib64 -m64 -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -Wl,-rpath -Wl,/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/lib64 -L/lib64 -lgdbm -fstack-protector-strong -L/usr/local/lib assertlibwuDdalOF.c -o assertlibiLBv3hMt -L/usr/local/cpanel/3rdparty/lib64/mariadb -lm
wrong result: 'mariadb'

@toddr
Copy link
Author

toddr commented Mar 17, 2017

$> echo "int main(int argc, char *argv[]) { return 0; }"  > foo.c

$> /usr/bin/gcc -DPERL_DISABLE_PMC -fPIC -DPIC -I/usr/local/cpanel/3rdparty/perl/524/include -L/usr/local/cpanel/3rdparty/perl/524/lib64 -I/usr/local/cpanel/3rdparty/include -L/usr/local/cpanel/3rdparty/lib64 -m64 -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -Wl,-rpath -Wl,/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/lib64 -L/lib64 -lgdbm -fstack-protector-strong -L/usr/local/lib foo.c -o foo -L/usr/local/cpanel/3rdparty/lib64/mariadb -lmariadb
$> ./foo
./foo: error while loading shared libraries: libmariadb.so.1: cannot open shared object file: No such file or directory
$> ldd foo
	linux-vdso.so.1 =>  (0x00007fff6e5fe000)
	libgdbm.so.4 => /lib64/libgdbm.so.4 (0x00007f3c91330000)
	libmariadb.so.1 => not found
	libc.so.6 => /lib64/libc.so.6 (0x00007f3c90f6e000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f3c91548000)

@toddr
Copy link
Author

toddr commented Mar 17, 2017

this works:

$> export LD_LIBRARY_PATH=/usr/local/cpanel/3rdparty/lib64/mariadb
$> ./foo
$> ldd foo
	linux-vdso.so.1 =>  (0x00007fffa1b31000)
	libgdbm.so.4 => /lib64/libgdbm.so.4 (0x00007f12ee242000)
	libmariadb.so.1 => /usr/local/cpanel/3rdparty/lib64/mariadb/libmariadb.so.1 (0x00007f12edfee000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f12edc2d000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f12eda11000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f12ed80c000)
	libssl.so.10 => /lib64/libssl.so.10 (0x00007f12ed5a0000)
	libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007f12ed1bb000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f12eceb8000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f12ee45a000)
	libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f12ecc6e000)
	libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f12ec98e000)
	libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f12ec789000)
	libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f12ec554000)
	libz.so.1 => /lib64/libz.so.1 (0x00007f12ec33e000)
	libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f12ec12f000)
	libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f12ebf2b000)
	libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f12ebd11000)
	libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f12ebae9000)
	libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f12eb888000)

@toddr
Copy link
Author

toddr commented Mar 17, 2017

This is starting to look like a bug in Devel::CheckLib. I notice that when I get past this and run make, it sets LD_RUN_PATH, which Devel::CheckLib doesn't seem to be doing?

rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/usr/local/cpanel/3rdparty/lib64/mariadb:/lib64" /usr/bin/gcc  -shared -Os -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/lib64 -L/lib64 -L/usr/local/lib -fstack-protector-strong dbdimp.o mysql.o socket.o  -o blib/arch/auto/DBD/mysql/mysql.so 	\
   -L/usr/local/cpanel/3rdparty/lib64/mariadb -lmariadb -lpthread -lssl -ldl -lm  	\

@toddr
Copy link
Author

toddr commented Mar 17, 2017

Looks like @salva beat me to the analysis: mattn/p5-Devel-CheckLib#19

@pali
Copy link
Member

pali commented Mar 17, 2017

From your output it is for sure problem with rpath. And really path specified in env LD_RUN_PATH for gcc is stored in output ELF binary as RPATH.

So I think it is bug in Devel::CheckLib too.

But we could workaround it and set LD_RUN_PATH env in perl before calling assert_lib().

Do you have idea how to make or makemaker fill LD_RUN_PATH?

@toddr
Copy link
Author

toddr commented Mar 17, 2017

EU::MM works fine. Devel::CheckLib is just reporting failure when there is none.

@pali
Copy link
Member

pali commented Mar 17, 2017

Yes EU::MM works fine, but if tou find out how EU::MM fills LD_RUN_PATH env, then we can use same algorithm also for Devel::CheckLib or setting $ENV{LD_RUN_PATH} before calling assert_lib().

@pali
Copy link
Member

pali commented Apr 15, 2017

It should be fixed in Devel::CheckLib 1.08. In CHANGES is:

1.08    2017-03-18      Add $LD_RUN_PATH for the libs.

mbeijen added a commit that referenced this issue Apr 15, 2017
mbeijen added a commit that referenced this issue Apr 16, 2017
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jul 10, 2017
Upstream changes:
2017-06-29 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.043)

YOUR ATTENTION PLEASE, THIS IS A REVERT TO 4.041
This version is the same as 4.041 with all its bugs and
limitations. In version 4.042 there were some changes to Unicode handling
that turned out to be causing issues with existing implementations.
While it is possible to argue that the old behaviour was wrong and buggy,
lots of applications and scripts were depending on this behaviour so it
is NOT a good idea to change this.

There were lots of commits since 4.041, we'll add those back bit by bit
in a future release, excluding the ones which cause problems.


2017-??-?? Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.042_01)
* Use Devel::CheckLib 1.09 or newer, fixes
   perl5-dbi/DBD-mysql#109
* Improve CI testing on AppVeyor: caching, path to cpan, configure deps (pali)
* Specify bigint as test dependency.

2017-03-08 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.042)
* Full release to include development releases 4.041_2 and 4.041_1.

2017-02-28 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041_2)
* Statement handle now also has mysql_sock attribute, just as database handle.
  (by Pali)
* Fix type conversions for magic types. Issue reported by Dmitriy Yatsenko and
  Giovanni Bechis, fix by Pali.
    https://lists.amavis.org/pipermail/amavis-users/2016-December/004674.html
    perl5-dbi/DBD-mysql#78
* Fix UTF8-encoding of table names, field names, warnings and error messages.
  Reported by Tanabe Yoshinori, fix by Pali.
    https://rt.cpan.org/Public/Bug/Display.html?id=120141
* Fix mysql_auto_reconnect when using mysql_server_prepare (pali). Reported by
  Vladimir Marek.
    perl5-dbi/DBD-mysql#95
* Improve regex for removing database from dsn (pali)
    https://rt.cpan.org/Public/Bug/Display.html?id=118837
* Locate MySQL libs using Devel::CheckLib (pali)
* Support async on Windows (pali)

* Fix test suite on range of older and newer MySQL and MariaDB versions
   (perl5-dbi/DBD-mysql#87)
* Fix compilation on MySQL 4.1 (pali)
* Do not leak dangling pointer to mysql result (pali)
* Fix logic when assigning to variable bind_comment_placeholders (pali)
* mysql_fd() still returned file descriptor after closing connection.
  Reported by Larry Leszczynski, fixed by Pali Roh獺r.
   (https://rt.cpan.org/Public/Bug/Display.html?id=110983)
* Fix parsing configure libs from mysql_config --libs output in Makefile.PL
  Libraries in mysql_config --libs output can be specified by library name
  with the -l prefix or by absolute path to library name without any prefix.
  Parameters must start with a hyphen, so treat all options without leading
  hyphen in mysql_config --libs output as libraries with full path.
  Partially fixes bug https://rt.cpan.org/Public/Bug/Display.html?id=100898
  Fix by Pali Roh獺r.
* Fix support for magic scalars (pali)
   (perl5-dbi/DBD-mysql#76)

2016-12-12 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041_1)
* Unicode fixes: when using mysql_enable_utf8 or mysql_enable_utf8mb4,
  previous versions of DBD::mysql did not properly encode input statements
  to UTF-8 and retrieved columns were always UTF-8 decoded regardless of the
  column charset.
  Fix by Pali Roh獺r.
  Reported and feedback on fix by Marc Lehmann
  (https://rt.cpan.org/Public/Bug/Display.html?id=87428)
  Also, the UTF-8 flag was not set for decoded data:
  (https://rt.cpan.org/Public/Bug/Display.html?id=53130)
* Return INTs with ZEROFILL as strings. Reported by Knarf, fix by Pali Roh獺r.
  (https://rt.cpan.org/Public/Bug/Display.html?id=118977)
derekstraka pushed a commit to derekstraka/meta-openembedded that referenced this issue Jan 26, 2018
Changes:

2017-06-29 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.043)

YOUR ATTENTION PLEASE, THIS IS A REVERT TO 4.041
This version is the same as 4.041 with all its bugs and
limitations. In version 4.042 there were some changes to Unicode handling
that turned out to be causing issues with existing implementations.
While it is possible to argue that the old behaviour was wrong and buggy,
lots of applications and scripts were depending on this behaviour so it
is NOT a good idea to change this.

There were lots of commits since 4.041, we'll add those back bit by bit
in a future release, excluding the ones which cause problems.

2017-??-?? Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.042_01)
* Use Devel::CheckLib 1.09 or newer, fixes
   perl5-dbi/DBD-mysql#109
* Improve CI testing on AppVeyor: caching, path to cpan, configure deps (pali)
* Specify bigint as test dependency.

2017-03-08 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.042)
* Full release to include development releases 4.041_2 and 4.041_1.

2017-02-28 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041_2)
* Statement handle now also has mysql_sock attribute, just as database handle.
  (by Pali)
* Fix type conversions for magic types. Issue reported by Dmitriy Yatsenko and
  Giovanni Bechis, fix by Pali.
    https://lists.amavis.org/pipermail/amavis-users/2016-December/004674.html
    perl5-dbi/DBD-mysql#78
* Fix UTF8-encoding of table names, field names, warnings and error messages.
  Reported by Tanabe Yoshinori, fix by Pali.
    https://rt.cpan.org/Public/Bug/Display.html?id=120141
* Fix mysql_auto_reconnect when using mysql_server_prepare (pali). Reported by
  Vladimir Marek.
    perl5-dbi/DBD-mysql#95
* Improve regex for removing database from dsn (pali)
    https://rt.cpan.org/Public/Bug/Display.html?id=118837
* Locate MySQL libs using Devel::CheckLib (pali)
* Support async on Windows (pali)

* Fix test suite on range of older and newer MySQL and MariaDB versions
   (perl5-dbi/DBD-mysql#87)
* Fix compilation on MySQL 4.1 (pali)
* Do not leak dangling pointer to mysql result (pali)
* Fix logic when assigning to variable bind_comment_placeholders (pali)
* mysql_fd() still returned file descriptor after closing connection.
  Reported by Larry Leszczynski, fixed by Pali Rohár.
   (https://rt.cpan.org/Public/Bug/Display.html?id=110983)
* Fix parsing configure libs from mysql_config --libs output in Makefile.PL
  Libraries in mysql_config --libs output can be specified by library name
  with the -l prefix or by absolute path to library name without any prefix.
  Parameters must start with a hyphen, so treat all options without leading
  hyphen in mysql_config --libs output as libraries with full path.
  Partially fixes bug https://rt.cpan.org/Public/Bug/Display.html?id=100898
  Fix by Pali Rohár.
* Fix support for magic scalars (pali)
   (perl5-dbi/DBD-mysql#76)

2016-12-12 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041_1)
* Unicode fixes: when using mysql_enable_utf8 or mysql_enable_utf8mb4,
  previous versions of DBD::mysql did not properly encode input statements
  to UTF-8 and retrieved columns were always UTF-8 decoded regardless of the
  column charset.
  Fix by Pali Rohár.
  Reported and feedback on fix by Marc Lehmann
  (https://rt.cpan.org/Public/Bug/Display.html?id=87428)
  Also, the UTF-8 flag was not set for decoded data:
  (https://rt.cpan.org/Public/Bug/Display.html?id=53130)
* Return INTs with ZEROFILL as strings. Reported by Knarf, fix by Pali Rohár.
  (https://rt.cpan.org/Public/Bug/Display.html?id=118977)

2016-11-28 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041)
* Fix use-after-free for repeated fetchrow_arrayref calls when
  mysql_server_prepare=1

  Function dbd_st_fetch() via Renew() can reallocate output buffer for
  mysql_stmt_fetch() call. But it does not update pointer to that buffer in
  imp_sth->stmt structure initialized by mysql_stmt_bind_result() function.
  That leads to use-after-free in any mysql function which access
  imp_sth->stmt structure (e.g. mysql_stmt_fetch()).

  This patch fix this problem and properly updates pointer in imp_sth->stmt
  structure after Renew() call.
  This is a medium level security issue to which the Debian security team
  assigned identifier CVE-2016-1251. Discovered and fixed by Pali Rohár.

* auto_reconnect now also matches  CR_SERVER_LOST, previously this only
  matched CR_SERVER_GONE.
  Fixes http://bugs.mysql.com/bug.php?id=27613
  Fix suggested by Wouter de Jong.
* Fix compilation fixes (Pali Rohár).

2016-11-19 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.040)
* Since 4.038 we had problems compiling on big-endian architectures, such
  as MIPS, s390 and Sparc. Thanks to Salvatore Bonaccorso @ Debian project
  (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844538)
  and Vladimir Marek (https://rt.cpan.org/Public/Bug/Display.html?id=118835)
  for reporting the issues. Fix by Pali Rohár.

  Fix integer types when server side prepare statements are enabled
  Fixed problems:
  * SQL_BIGINT was incorrectly handled as 32bit MYSQL_TYPE_LONG type instead
    64bit MYSQL_TYPE_LONGLONG which led to integer overflow/underflow
  * 32bit MYSQL_TYPE_LONG was used for perl's IV storage when IV was 64bit
    and 64bit MYSQL_TYPE_LONGLONG was used when IV was 32bit
  * All unsigned types were handled as signed, so all high positive values
    were treated as negative
  * Numeric conversions in perl which led to overflow/underflow was ignored
    even when mysql strict mode was enabled
  * Test t/41int_min_max.t was running only for normal non-prepared statements
  * Test t/40server_prepare.t used incorrect SQL type for big (64bit) integers

2016-11-15 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.039)
* Fix for security issue Out-of-bounds read by DBD::mysql CVE-2016-1249 (pali)

2016-10-30 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.038_01)
* Fix compilation of embedded server (pali)
  (perl5-dbi/DBD-mysql#68)
* Fix compilation against libmariadbclient. First version by
  H.Merijn Brand, improved by Bernt Johnsen @ Oracle.
* For efficiency use newSVpvn() instead newSVpv() where possible (pali)
* Correctly coerce fetched scalar values when mysql_server_prepare is
  not used (pali)
* Add support for fetching columns of BIT type with
  mysql_server_prepare = 1 (pali)
  Fixes https://rt.cpan.org/Public/Bug/Display.html?id=88006
* Use correct format in printf instead of casting variable types (pali)
* Include errno.h for MYSQL_ASYNC because it uses errno variable (pali)
* Travis: also test on perl 5.22 and 5.24.

2016-10-19 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.038)
* Version 4.037_1 had fixes for MySQL 8.0 provided
  Bernt Johnsen @ Oracle that were not in the Changelogs
  (perl5-dbi/DBD-mysql#56)
* Fixes for compiling against newer libmysqlclient on Windows (kmx)
* Fix unit test for 40server_prepare_crash on Windows (pali)
* Perl's IV in scalar can store 64bit integer when perl was compiled
  with 64 bit support (default on 64bit linux with gcc). Use this
  feature and stores MYSQL_TYPE_LONGLONG as integers instead of strings
  when possible. (pali, perl5-dbi/DBD-mysql#57)

2016-10-14 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.037_01)
* Newest versions of libmysqlclient and the MariaDB C connector no longer
  export the __WIN__ macro. If this macro is not present we would not
  compile in the poll.h-based async-support. Changed to use the _WIN32
  macro instead. Thanks to Sergei Golubchik for suggesting the fix.
* Fix from Pali Rohár for use-after-free in prepared statements,
  changes to bind logic, and added test 40server_prepare_crash.

2016-10-03 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.037)
* Security release to patch possible buffer overflow in unsafe sprintf with
  variable length. Reported and fixed by Pali Rohár. This vulnerability
  is present in all releases at least back to versions 3.0 of the
  driver, which were released in 2005.
  The CVE identifier for this vulnerability is CVE-2016-1246.

Signed-off-by: Tim Orling <[email protected]>
Signed-off-by: Armin Kuster <[email protected]>
halstead pushed a commit to openembedded/meta-openembedded that referenced this issue Jan 27, 2018
Changes:

2017-06-29 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.043)

YOUR ATTENTION PLEASE, THIS IS A REVERT TO 4.041
This version is the same as 4.041 with all its bugs and
limitations. In version 4.042 there were some changes to Unicode handling
that turned out to be causing issues with existing implementations.
While it is possible to argue that the old behaviour was wrong and buggy,
lots of applications and scripts were depending on this behaviour so it
is NOT a good idea to change this.

There were lots of commits since 4.041, we'll add those back bit by bit
in a future release, excluding the ones which cause problems.

2017-??-?? Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.042_01)
* Use Devel::CheckLib 1.09 or newer, fixes
   perl5-dbi/DBD-mysql#109
* Improve CI testing on AppVeyor: caching, path to cpan, configure deps (pali)
* Specify bigint as test dependency.

2017-03-08 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.042)
* Full release to include development releases 4.041_2 and 4.041_1.

2017-02-28 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041_2)
* Statement handle now also has mysql_sock attribute, just as database handle.
  (by Pali)
* Fix type conversions for magic types. Issue reported by Dmitriy Yatsenko and
  Giovanni Bechis, fix by Pali.
    https://lists.amavis.org/pipermail/amavis-users/2016-December/004674.html
    perl5-dbi/DBD-mysql#78
* Fix UTF8-encoding of table names, field names, warnings and error messages.
  Reported by Tanabe Yoshinori, fix by Pali.
    https://rt.cpan.org/Public/Bug/Display.html?id=120141
* Fix mysql_auto_reconnect when using mysql_server_prepare (pali). Reported by
  Vladimir Marek.
    perl5-dbi/DBD-mysql#95
* Improve regex for removing database from dsn (pali)
    https://rt.cpan.org/Public/Bug/Display.html?id=118837
* Locate MySQL libs using Devel::CheckLib (pali)
* Support async on Windows (pali)

* Fix test suite on range of older and newer MySQL and MariaDB versions
   (perl5-dbi/DBD-mysql#87)
* Fix compilation on MySQL 4.1 (pali)
* Do not leak dangling pointer to mysql result (pali)
* Fix logic when assigning to variable bind_comment_placeholders (pali)
* mysql_fd() still returned file descriptor after closing connection.
  Reported by Larry Leszczynski, fixed by Pali Rohár.
   (https://rt.cpan.org/Public/Bug/Display.html?id=110983)
* Fix parsing configure libs from mysql_config --libs output in Makefile.PL
  Libraries in mysql_config --libs output can be specified by library name
  with the -l prefix or by absolute path to library name without any prefix.
  Parameters must start with a hyphen, so treat all options without leading
  hyphen in mysql_config --libs output as libraries with full path.
  Partially fixes bug https://rt.cpan.org/Public/Bug/Display.html?id=100898
  Fix by Pali Rohár.
* Fix support for magic scalars (pali)
   (perl5-dbi/DBD-mysql#76)

2016-12-12 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041_1)
* Unicode fixes: when using mysql_enable_utf8 or mysql_enable_utf8mb4,
  previous versions of DBD::mysql did not properly encode input statements
  to UTF-8 and retrieved columns were always UTF-8 decoded regardless of the
  column charset.
  Fix by Pali Rohár.
  Reported and feedback on fix by Marc Lehmann
  (https://rt.cpan.org/Public/Bug/Display.html?id=87428)
  Also, the UTF-8 flag was not set for decoded data:
  (https://rt.cpan.org/Public/Bug/Display.html?id=53130)
* Return INTs with ZEROFILL as strings. Reported by Knarf, fix by Pali Rohár.
  (https://rt.cpan.org/Public/Bug/Display.html?id=118977)

2016-11-28 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041)
* Fix use-after-free for repeated fetchrow_arrayref calls when
  mysql_server_prepare=1

  Function dbd_st_fetch() via Renew() can reallocate output buffer for
  mysql_stmt_fetch() call. But it does not update pointer to that buffer in
  imp_sth->stmt structure initialized by mysql_stmt_bind_result() function.
  That leads to use-after-free in any mysql function which access
  imp_sth->stmt structure (e.g. mysql_stmt_fetch()).

  This patch fix this problem and properly updates pointer in imp_sth->stmt
  structure after Renew() call.
  This is a medium level security issue to which the Debian security team
  assigned identifier CVE-2016-1251. Discovered and fixed by Pali Rohár.

* auto_reconnect now also matches  CR_SERVER_LOST, previously this only
  matched CR_SERVER_GONE.
  Fixes http://bugs.mysql.com/bug.php?id=27613
  Fix suggested by Wouter de Jong.
* Fix compilation fixes (Pali Rohár).

2016-11-19 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.040)
* Since 4.038 we had problems compiling on big-endian architectures, such
  as MIPS, s390 and Sparc. Thanks to Salvatore Bonaccorso @ Debian project
  (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844538)
  and Vladimir Marek (https://rt.cpan.org/Public/Bug/Display.html?id=118835)
  for reporting the issues. Fix by Pali Rohár.

  Fix integer types when server side prepare statements are enabled
  Fixed problems:
  * SQL_BIGINT was incorrectly handled as 32bit MYSQL_TYPE_LONG type instead
    64bit MYSQL_TYPE_LONGLONG which led to integer overflow/underflow
  * 32bit MYSQL_TYPE_LONG was used for perl's IV storage when IV was 64bit
    and 64bit MYSQL_TYPE_LONGLONG was used when IV was 32bit
  * All unsigned types were handled as signed, so all high positive values
    were treated as negative
  * Numeric conversions in perl which led to overflow/underflow was ignored
    even when mysql strict mode was enabled
  * Test t/41int_min_max.t was running only for normal non-prepared statements
  * Test t/40server_prepare.t used incorrect SQL type for big (64bit) integers

2016-11-15 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.039)
* Fix for security issue Out-of-bounds read by DBD::mysql CVE-2016-1249 (pali)

2016-10-30 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.038_01)
* Fix compilation of embedded server (pali)
  (perl5-dbi/DBD-mysql#68)
* Fix compilation against libmariadbclient. First version by
  H.Merijn Brand, improved by Bernt Johnsen @ Oracle.
* For efficiency use newSVpvn() instead newSVpv() where possible (pali)
* Correctly coerce fetched scalar values when mysql_server_prepare is
  not used (pali)
* Add support for fetching columns of BIT type with
  mysql_server_prepare = 1 (pali)
  Fixes https://rt.cpan.org/Public/Bug/Display.html?id=88006
* Use correct format in printf instead of casting variable types (pali)
* Include errno.h for MYSQL_ASYNC because it uses errno variable (pali)
* Travis: also test on perl 5.22 and 5.24.

2016-10-19 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.038)
* Version 4.037_1 had fixes for MySQL 8.0 provided
  Bernt Johnsen @ Oracle that were not in the Changelogs
  (perl5-dbi/DBD-mysql#56)
* Fixes for compiling against newer libmysqlclient on Windows (kmx)
* Fix unit test for 40server_prepare_crash on Windows (pali)
* Perl's IV in scalar can store 64bit integer when perl was compiled
  with 64 bit support (default on 64bit linux with gcc). Use this
  feature and stores MYSQL_TYPE_LONGLONG as integers instead of strings
  when possible. (pali, perl5-dbi/DBD-mysql#57)

2016-10-14 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.037_01)
* Newest versions of libmysqlclient and the MariaDB C connector no longer
  export the __WIN__ macro. If this macro is not present we would not
  compile in the poll.h-based async-support. Changed to use the _WIN32
  macro instead. Thanks to Sergei Golubchik for suggesting the fix.
* Fix from Pali Rohár for use-after-free in prepared statements,
  changes to bind logic, and added test 40server_prepare_crash.

2016-10-03 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.037)
* Security release to patch possible buffer overflow in unsafe sprintf with
  variable length. Reported and fixed by Pali Rohár. This vulnerability
  is present in all releases at least back to versions 3.0 of the
  driver, which were released in 2005.
  The CVE identifier for this vulnerability is CVE-2016-1246.

Signed-off-by: Tim Orling <[email protected]>
Signed-off-by: Armin Kuster <[email protected]>
mbeijen added a commit that referenced this issue Feb 12, 2018
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Sep 9, 2018
2018-09-08 Daniël van Eeden, Patrick Galbraith, DBI/DBD community (4.047)
* Add options needed for public key based security.
* Allow several spaces after LIMIT clause.
* Basic GTID tracking.
* Fix GCC 8.1 warnings
* Fix warning: unused variable ‘buffer_len’
* Fix warning about bind->is_null assignment with incompatible pointer type
* Get rid of warning about unused variable ssl_verify_set
* Fix space/tab issue which leads to misleading indentation
* Change spaces/tabs to get rid of GCC8 warning

2018-03-09 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.046_01)
* Updated documentation re. multithreading (Daniël van Eeden)
* Remove #IFDEFs for code detecting ancient DBI versions. The minimum
  DBI version we require is version 1.609 from 2009!
* ChopBlanks should not trim binary fields (urcheon)
* Skipped test which failed on OpenBSD because Proc::ProcessTable does not
  come with a 'size' attribute on this platform (glasswalk3r, pali)
* Improved test suite with regards to MySQL 8.0
* Improved macOS installation notes.
* Use Devel::CheckLib 1.09 or newer, fixes
   perl5-dbi/DBD-mysql#109
* Specify bigint as test dependency
* Add recommends and suggests tests dependencies (pali)
* Check only for libs via Devel::CheckLib in Makefile.PL (pali)
* Remove param --with-mysql from Makefile.PL documentation (pali)
* Check if specified Makefile.PL settings are working (pali)
   Fixes https://rt.cpan.org/Ticket/Display.html?id=119902
* Remember mysql_config value for Makefile.PL (pali)
* Locate MySQL libs using Devel::CheckLib (pali)
* Added a fix for 30insertfetch failure when using server-side prepared
  statements. The stmt was being freed for DML statements before
  the handle attribute was read, mysql_info was reading back nulls
bigio pushed a commit to bigio/DBD-mysql that referenced this issue Jan 9, 2019
bigio pushed a commit to bigio/DBD-mysql that referenced this issue Jan 9, 2019
sgunin pushed a commit to sgunin/oe-meta-openembedded-contrib that referenced this issue Mar 17, 2024
Changes:

2017-06-29 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.043)

YOUR ATTENTION PLEASE, THIS IS A REVERT TO 4.041
This version is the same as 4.041 with all its bugs and
limitations. In version 4.042 there were some changes to Unicode handling
that turned out to be causing issues with existing implementations.
While it is possible to argue that the old behaviour was wrong and buggy,
lots of applications and scripts were depending on this behaviour so it
is NOT a good idea to change this.

There were lots of commits since 4.041, we'll add those back bit by bit
in a future release, excluding the ones which cause problems.

2017-??-?? Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.042_01)
* Use Devel::CheckLib 1.09 or newer, fixes
   perl5-dbi/DBD-mysql#109
* Improve CI testing on AppVeyor: caching, path to cpan, configure deps (pali)
* Specify bigint as test dependency.

2017-03-08 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.042)
* Full release to include development releases 4.041_2 and 4.041_1.

2017-02-28 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041_2)
* Statement handle now also has mysql_sock attribute, just as database handle.
  (by Pali)
* Fix type conversions for magic types. Issue reported by Dmitriy Yatsenko and
  Giovanni Bechis, fix by Pali.
    https://lists.amavis.org/pipermail/amavis-users/2016-December/004674.html
    perl5-dbi/DBD-mysql#78
* Fix UTF8-encoding of table names, field names, warnings and error messages.
  Reported by Tanabe Yoshinori, fix by Pali.
    https://rt.cpan.org/Public/Bug/Display.html?id=120141
* Fix mysql_auto_reconnect when using mysql_server_prepare (pali). Reported by
  Vladimir Marek.
    perl5-dbi/DBD-mysql#95
* Improve regex for removing database from dsn (pali)
    https://rt.cpan.org/Public/Bug/Display.html?id=118837
* Locate MySQL libs using Devel::CheckLib (pali)
* Support async on Windows (pali)

* Fix test suite on range of older and newer MySQL and MariaDB versions
   (perl5-dbi/DBD-mysql#87)
* Fix compilation on MySQL 4.1 (pali)
* Do not leak dangling pointer to mysql result (pali)
* Fix logic when assigning to variable bind_comment_placeholders (pali)
* mysql_fd() still returned file descriptor after closing connection.
  Reported by Larry Leszczynski, fixed by Pali Rohár.
   (https://rt.cpan.org/Public/Bug/Display.html?id=110983)
* Fix parsing configure libs from mysql_config --libs output in Makefile.PL
  Libraries in mysql_config --libs output can be specified by library name
  with the -l prefix or by absolute path to library name without any prefix.
  Parameters must start with a hyphen, so treat all options without leading
  hyphen in mysql_config --libs output as libraries with full path.
  Partially fixes bug https://rt.cpan.org/Public/Bug/Display.html?id=100898
  Fix by Pali Rohár.
* Fix support for magic scalars (pali)
   (perl5-dbi/DBD-mysql#76)

2016-12-12 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041_1)
* Unicode fixes: when using mysql_enable_utf8 or mysql_enable_utf8mb4,
  previous versions of DBD::mysql did not properly encode input statements
  to UTF-8 and retrieved columns were always UTF-8 decoded regardless of the
  column charset.
  Fix by Pali Rohár.
  Reported and feedback on fix by Marc Lehmann
  (https://rt.cpan.org/Public/Bug/Display.html?id=87428)
  Also, the UTF-8 flag was not set for decoded data:
  (https://rt.cpan.org/Public/Bug/Display.html?id=53130)
* Return INTs with ZEROFILL as strings. Reported by Knarf, fix by Pali Rohár.
  (https://rt.cpan.org/Public/Bug/Display.html?id=118977)

2016-11-28 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041)
* Fix use-after-free for repeated fetchrow_arrayref calls when
  mysql_server_prepare=1

  Function dbd_st_fetch() via Renew() can reallocate output buffer for
  mysql_stmt_fetch() call. But it does not update pointer to that buffer in
  imp_sth->stmt structure initialized by mysql_stmt_bind_result() function.
  That leads to use-after-free in any mysql function which access
  imp_sth->stmt structure (e.g. mysql_stmt_fetch()).

  This patch fix this problem and properly updates pointer in imp_sth->stmt
  structure after Renew() call.
  This is a medium level security issue to which the Debian security team
  assigned identifier CVE-2016-1251. Discovered and fixed by Pali Rohár.

* auto_reconnect now also matches  CR_SERVER_LOST, previously this only
  matched CR_SERVER_GONE.
  Fixes http://bugs.mysql.com/bug.php?id=27613
  Fix suggested by Wouter de Jong.
* Fix compilation fixes (Pali Rohár).

2016-11-19 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.040)
* Since 4.038 we had problems compiling on big-endian architectures, such
  as MIPS, s390 and Sparc. Thanks to Salvatore Bonaccorso @ Debian project
  (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844538)
  and Vladimir Marek (https://rt.cpan.org/Public/Bug/Display.html?id=118835)
  for reporting the issues. Fix by Pali Rohár.

  Fix integer types when server side prepare statements are enabled
  Fixed problems:
  * SQL_BIGINT was incorrectly handled as 32bit MYSQL_TYPE_LONG type instead
    64bit MYSQL_TYPE_LONGLONG which led to integer overflow/underflow
  * 32bit MYSQL_TYPE_LONG was used for perl's IV storage when IV was 64bit
    and 64bit MYSQL_TYPE_LONGLONG was used when IV was 32bit
  * All unsigned types were handled as signed, so all high positive values
    were treated as negative
  * Numeric conversions in perl which led to overflow/underflow was ignored
    even when mysql strict mode was enabled
  * Test t/41int_min_max.t was running only for normal non-prepared statements
  * Test t/40server_prepare.t used incorrect SQL type for big (64bit) integers

2016-11-15 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.039)
* Fix for security issue Out-of-bounds read by DBD::mysql CVE-2016-1249 (pali)

2016-10-30 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.038_01)
* Fix compilation of embedded server (pali)
  (perl5-dbi/DBD-mysql#68)
* Fix compilation against libmariadbclient. First version by
  H.Merijn Brand, improved by Bernt Johnsen @ Oracle.
* For efficiency use newSVpvn() instead newSVpv() where possible (pali)
* Correctly coerce fetched scalar values when mysql_server_prepare is
  not used (pali)
* Add support for fetching columns of BIT type with
  mysql_server_prepare = 1 (pali)
  Fixes https://rt.cpan.org/Public/Bug/Display.html?id=88006
* Use correct format in printf instead of casting variable types (pali)
* Include errno.h for MYSQL_ASYNC because it uses errno variable (pali)
* Travis: also test on perl 5.22 and 5.24.

2016-10-19 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.038)
* Version 4.037_1 had fixes for MySQL 8.0 provided
  Bernt Johnsen @ Oracle that were not in the Changelogs
  (perl5-dbi/DBD-mysql#56)
* Fixes for compiling against newer libmysqlclient on Windows (kmx)
* Fix unit test for 40server_prepare_crash on Windows (pali)
* Perl's IV in scalar can store 64bit integer when perl was compiled
  with 64 bit support (default on 64bit linux with gcc). Use this
  feature and stores MYSQL_TYPE_LONGLONG as integers instead of strings
  when possible. (pali, perl5-dbi/DBD-mysql#57)

2016-10-14 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.037_01)
* Newest versions of libmysqlclient and the MariaDB C connector no longer
  export the __WIN__ macro. If this macro is not present we would not
  compile in the poll.h-based async-support. Changed to use the _WIN32
  macro instead. Thanks to Sergei Golubchik for suggesting the fix.
* Fix from Pali Rohár for use-after-free in prepared statements,
  changes to bind logic, and added test 40server_prepare_crash.

2016-10-03 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.037)
* Security release to patch possible buffer overflow in unsafe sprintf with
  variable length. Reported and fixed by Pali Rohár. This vulnerability
  is present in all releases at least back to versions 3.0 of the
  driver, which were released in 2005.
  The CVE identifier for this vulnerability is CVE-2016-1246.

Signed-off-by: Tim Orling <[email protected]>
daregit pushed a commit to daregit/yocto-combined that referenced this issue May 22, 2024
Changes:

2017-06-29 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.043)

YOUR ATTENTION PLEASE, THIS IS A REVERT TO 4.041
This version is the same as 4.041 with all its bugs and
limitations. In version 4.042 there were some changes to Unicode handling
that turned out to be causing issues with existing implementations.
While it is possible to argue that the old behaviour was wrong and buggy,
lots of applications and scripts were depending on this behaviour so it
is NOT a good idea to change this.

There were lots of commits since 4.041, we'll add those back bit by bit
in a future release, excluding the ones which cause problems.

2017-??-?? Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.042_01)
* Use Devel::CheckLib 1.09 or newer, fixes
   perl5-dbi/DBD-mysql#109
* Improve CI testing on AppVeyor: caching, path to cpan, configure deps (pali)
* Specify bigint as test dependency.

2017-03-08 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.042)
* Full release to include development releases 4.041_2 and 4.041_1.

2017-02-28 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041_2)
* Statement handle now also has mysql_sock attribute, just as database handle.
  (by Pali)
* Fix type conversions for magic types. Issue reported by Dmitriy Yatsenko and
  Giovanni Bechis, fix by Pali.
    https://lists.amavis.org/pipermail/amavis-users/2016-December/004674.html
    perl5-dbi/DBD-mysql#78
* Fix UTF8-encoding of table names, field names, warnings and error messages.
  Reported by Tanabe Yoshinori, fix by Pali.
    https://rt.cpan.org/Public/Bug/Display.html?id=120141
* Fix mysql_auto_reconnect when using mysql_server_prepare (pali). Reported by
  Vladimir Marek.
    perl5-dbi/DBD-mysql#95
* Improve regex for removing database from dsn (pali)
    https://rt.cpan.org/Public/Bug/Display.html?id=118837
* Locate MySQL libs using Devel::CheckLib (pali)
* Support async on Windows (pali)

* Fix test suite on range of older and newer MySQL and MariaDB versions
   (perl5-dbi/DBD-mysql#87)
* Fix compilation on MySQL 4.1 (pali)
* Do not leak dangling pointer to mysql result (pali)
* Fix logic when assigning to variable bind_comment_placeholders (pali)
* mysql_fd() still returned file descriptor after closing connection.
  Reported by Larry Leszczynski, fixed by Pali Rohár.
   (https://rt.cpan.org/Public/Bug/Display.html?id=110983)
* Fix parsing configure libs from mysql_config --libs output in Makefile.PL
  Libraries in mysql_config --libs output can be specified by library name
  with the -l prefix or by absolute path to library name without any prefix.
  Parameters must start with a hyphen, so treat all options without leading
  hyphen in mysql_config --libs output as libraries with full path.
  Partially fixes bug https://rt.cpan.org/Public/Bug/Display.html?id=100898
  Fix by Pali Rohár.
* Fix support for magic scalars (pali)
   (perl5-dbi/DBD-mysql#76)

2016-12-12 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041_1)
* Unicode fixes: when using mysql_enable_utf8 or mysql_enable_utf8mb4,
  previous versions of DBD::mysql did not properly encode input statements
  to UTF-8 and retrieved columns were always UTF-8 decoded regardless of the
  column charset.
  Fix by Pali Rohár.
  Reported and feedback on fix by Marc Lehmann
  (https://rt.cpan.org/Public/Bug/Display.html?id=87428)
  Also, the UTF-8 flag was not set for decoded data:
  (https://rt.cpan.org/Public/Bug/Display.html?id=53130)
* Return INTs with ZEROFILL as strings. Reported by Knarf, fix by Pali Rohár.
  (https://rt.cpan.org/Public/Bug/Display.html?id=118977)

2016-11-28 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041)
* Fix use-after-free for repeated fetchrow_arrayref calls when
  mysql_server_prepare=1

  Function dbd_st_fetch() via Renew() can reallocate output buffer for
  mysql_stmt_fetch() call. But it does not update pointer to that buffer in
  imp_sth->stmt structure initialized by mysql_stmt_bind_result() function.
  That leads to use-after-free in any mysql function which access
  imp_sth->stmt structure (e.g. mysql_stmt_fetch()).

  This patch fix this problem and properly updates pointer in imp_sth->stmt
  structure after Renew() call.
  This is a medium level security issue to which the Debian security team
  assigned identifier CVE-2016-1251. Discovered and fixed by Pali Rohár.

* auto_reconnect now also matches  CR_SERVER_LOST, previously this only
  matched CR_SERVER_GONE.
  Fixes http://bugs.mysql.com/bug.php?id=27613
  Fix suggested by Wouter de Jong.
* Fix compilation fixes (Pali Rohár).

2016-11-19 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.040)
* Since 4.038 we had problems compiling on big-endian architectures, such
  as MIPS, s390 and Sparc. Thanks to Salvatore Bonaccorso @ Debian project
  (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844538)
  and Vladimir Marek (https://rt.cpan.org/Public/Bug/Display.html?id=118835)
  for reporting the issues. Fix by Pali Rohár.

  Fix integer types when server side prepare statements are enabled
  Fixed problems:
  * SQL_BIGINT was incorrectly handled as 32bit MYSQL_TYPE_LONG type instead
    64bit MYSQL_TYPE_LONGLONG which led to integer overflow/underflow
  * 32bit MYSQL_TYPE_LONG was used for perl's IV storage when IV was 64bit
    and 64bit MYSQL_TYPE_LONGLONG was used when IV was 32bit
  * All unsigned types were handled as signed, so all high positive values
    were treated as negative
  * Numeric conversions in perl which led to overflow/underflow was ignored
    even when mysql strict mode was enabled
  * Test t/41int_min_max.t was running only for normal non-prepared statements
  * Test t/40server_prepare.t used incorrect SQL type for big (64bit) integers

2016-11-15 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.039)
* Fix for security issue Out-of-bounds read by DBD::mysql CVE-2016-1249 (pali)

2016-10-30 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.038_01)
* Fix compilation of embedded server (pali)
  (perl5-dbi/DBD-mysql#68)
* Fix compilation against libmariadbclient. First version by
  H.Merijn Brand, improved by Bernt Johnsen @ Oracle.
* For efficiency use newSVpvn() instead newSVpv() where possible (pali)
* Correctly coerce fetched scalar values when mysql_server_prepare is
  not used (pali)
* Add support for fetching columns of BIT type with
  mysql_server_prepare = 1 (pali)
  Fixes https://rt.cpan.org/Public/Bug/Display.html?id=88006
* Use correct format in printf instead of casting variable types (pali)
* Include errno.h for MYSQL_ASYNC because it uses errno variable (pali)
* Travis: also test on perl 5.22 and 5.24.

2016-10-19 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.038)
* Version 4.037_1 had fixes for MySQL 8.0 provided
  Bernt Johnsen @ Oracle that were not in the Changelogs
  (perl5-dbi/DBD-mysql#56)
* Fixes for compiling against newer libmysqlclient on Windows (kmx)
* Fix unit test for 40server_prepare_crash on Windows (pali)
* Perl's IV in scalar can store 64bit integer when perl was compiled
  with 64 bit support (default on 64bit linux with gcc). Use this
  feature and stores MYSQL_TYPE_LONGLONG as integers instead of strings
  when possible. (pali, perl5-dbi/DBD-mysql#57)

2016-10-14 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.037_01)
* Newest versions of libmysqlclient and the MariaDB C connector no longer
  export the __WIN__ macro. If this macro is not present we would not
  compile in the poll.h-based async-support. Changed to use the _WIN32
  macro instead. Thanks to Sergei Golubchik for suggesting the fix.
* Fix from Pali Rohár for use-after-free in prepared statements,
  changes to bind logic, and added test 40server_prepare_crash.

2016-10-03 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.037)
* Security release to patch possible buffer overflow in unsafe sprintf with
  variable length. Reported and fixed by Pali Rohár. This vulnerability
  is present in all releases at least back to versions 3.0 of the
  driver, which were released in 2005.
  The CVE identifier for this vulnerability is CVE-2016-1246.

Signed-off-by: Tim Orling <[email protected]>
Signed-off-by: Armin Kuster <[email protected]>
daregit pushed a commit to daregit/yocto-combined that referenced this issue May 22, 2024
Changes:

2017-06-29 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.043)

YOUR ATTENTION PLEASE, THIS IS A REVERT TO 4.041
This version is the same as 4.041 with all its bugs and
limitations. In version 4.042 there were some changes to Unicode handling
that turned out to be causing issues with existing implementations.
While it is possible to argue that the old behaviour was wrong and buggy,
lots of applications and scripts were depending on this behaviour so it
is NOT a good idea to change this.

There were lots of commits since 4.041, we'll add those back bit by bit
in a future release, excluding the ones which cause problems.

2017-??-?? Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.042_01)
* Use Devel::CheckLib 1.09 or newer, fixes
   perl5-dbi/DBD-mysql#109
* Improve CI testing on AppVeyor: caching, path to cpan, configure deps (pali)
* Specify bigint as test dependency.

2017-03-08 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.042)
* Full release to include development releases 4.041_2 and 4.041_1.

2017-02-28 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041_2)
* Statement handle now also has mysql_sock attribute, just as database handle.
  (by Pali)
* Fix type conversions for magic types. Issue reported by Dmitriy Yatsenko and
  Giovanni Bechis, fix by Pali.
    https://lists.amavis.org/pipermail/amavis-users/2016-December/004674.html
    perl5-dbi/DBD-mysql#78
* Fix UTF8-encoding of table names, field names, warnings and error messages.
  Reported by Tanabe Yoshinori, fix by Pali.
    https://rt.cpan.org/Public/Bug/Display.html?id=120141
* Fix mysql_auto_reconnect when using mysql_server_prepare (pali). Reported by
  Vladimir Marek.
    perl5-dbi/DBD-mysql#95
* Improve regex for removing database from dsn (pali)
    https://rt.cpan.org/Public/Bug/Display.html?id=118837
* Locate MySQL libs using Devel::CheckLib (pali)
* Support async on Windows (pali)

* Fix test suite on range of older and newer MySQL and MariaDB versions
   (perl5-dbi/DBD-mysql#87)
* Fix compilation on MySQL 4.1 (pali)
* Do not leak dangling pointer to mysql result (pali)
* Fix logic when assigning to variable bind_comment_placeholders (pali)
* mysql_fd() still returned file descriptor after closing connection.
  Reported by Larry Leszczynski, fixed by Pali Rohár.
   (https://rt.cpan.org/Public/Bug/Display.html?id=110983)
* Fix parsing configure libs from mysql_config --libs output in Makefile.PL
  Libraries in mysql_config --libs output can be specified by library name
  with the -l prefix or by absolute path to library name without any prefix.
  Parameters must start with a hyphen, so treat all options without leading
  hyphen in mysql_config --libs output as libraries with full path.
  Partially fixes bug https://rt.cpan.org/Public/Bug/Display.html?id=100898
  Fix by Pali Rohár.
* Fix support for magic scalars (pali)
   (perl5-dbi/DBD-mysql#76)

2016-12-12 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041_1)
* Unicode fixes: when using mysql_enable_utf8 or mysql_enable_utf8mb4,
  previous versions of DBD::mysql did not properly encode input statements
  to UTF-8 and retrieved columns were always UTF-8 decoded regardless of the
  column charset.
  Fix by Pali Rohár.
  Reported and feedback on fix by Marc Lehmann
  (https://rt.cpan.org/Public/Bug/Display.html?id=87428)
  Also, the UTF-8 flag was not set for decoded data:
  (https://rt.cpan.org/Public/Bug/Display.html?id=53130)
* Return INTs with ZEROFILL as strings. Reported by Knarf, fix by Pali Rohár.
  (https://rt.cpan.org/Public/Bug/Display.html?id=118977)

2016-11-28 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041)
* Fix use-after-free for repeated fetchrow_arrayref calls when
  mysql_server_prepare=1

  Function dbd_st_fetch() via Renew() can reallocate output buffer for
  mysql_stmt_fetch() call. But it does not update pointer to that buffer in
  imp_sth->stmt structure initialized by mysql_stmt_bind_result() function.
  That leads to use-after-free in any mysql function which access
  imp_sth->stmt structure (e.g. mysql_stmt_fetch()).

  This patch fix this problem and properly updates pointer in imp_sth->stmt
  structure after Renew() call.
  This is a medium level security issue to which the Debian security team
  assigned identifier CVE-2016-1251. Discovered and fixed by Pali Rohár.

* auto_reconnect now also matches  CR_SERVER_LOST, previously this only
  matched CR_SERVER_GONE.
  Fixes http://bugs.mysql.com/bug.php?id=27613
  Fix suggested by Wouter de Jong.
* Fix compilation fixes (Pali Rohár).

2016-11-19 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.040)
* Since 4.038 we had problems compiling on big-endian architectures, such
  as MIPS, s390 and Sparc. Thanks to Salvatore Bonaccorso @ Debian project
  (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844538)
  and Vladimir Marek (https://rt.cpan.org/Public/Bug/Display.html?id=118835)
  for reporting the issues. Fix by Pali Rohár.

  Fix integer types when server side prepare statements are enabled
  Fixed problems:
  * SQL_BIGINT was incorrectly handled as 32bit MYSQL_TYPE_LONG type instead
    64bit MYSQL_TYPE_LONGLONG which led to integer overflow/underflow
  * 32bit MYSQL_TYPE_LONG was used for perl's IV storage when IV was 64bit
    and 64bit MYSQL_TYPE_LONGLONG was used when IV was 32bit
  * All unsigned types were handled as signed, so all high positive values
    were treated as negative
  * Numeric conversions in perl which led to overflow/underflow was ignored
    even when mysql strict mode was enabled
  * Test t/41int_min_max.t was running only for normal non-prepared statements
  * Test t/40server_prepare.t used incorrect SQL type for big (64bit) integers

2016-11-15 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.039)
* Fix for security issue Out-of-bounds read by DBD::mysql CVE-2016-1249 (pali)

2016-10-30 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.038_01)
* Fix compilation of embedded server (pali)
  (perl5-dbi/DBD-mysql#68)
* Fix compilation against libmariadbclient. First version by
  H.Merijn Brand, improved by Bernt Johnsen @ Oracle.
* For efficiency use newSVpvn() instead newSVpv() where possible (pali)
* Correctly coerce fetched scalar values when mysql_server_prepare is
  not used (pali)
* Add support for fetching columns of BIT type with
  mysql_server_prepare = 1 (pali)
  Fixes https://rt.cpan.org/Public/Bug/Display.html?id=88006
* Use correct format in printf instead of casting variable types (pali)
* Include errno.h for MYSQL_ASYNC because it uses errno variable (pali)
* Travis: also test on perl 5.22 and 5.24.

2016-10-19 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.038)
* Version 4.037_1 had fixes for MySQL 8.0 provided
  Bernt Johnsen @ Oracle that were not in the Changelogs
  (perl5-dbi/DBD-mysql#56)
* Fixes for compiling against newer libmysqlclient on Windows (kmx)
* Fix unit test for 40server_prepare_crash on Windows (pali)
* Perl's IV in scalar can store 64bit integer when perl was compiled
  with 64 bit support (default on 64bit linux with gcc). Use this
  feature and stores MYSQL_TYPE_LONGLONG as integers instead of strings
  when possible. (pali, perl5-dbi/DBD-mysql#57)

2016-10-14 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.037_01)
* Newest versions of libmysqlclient and the MariaDB C connector no longer
  export the __WIN__ macro. If this macro is not present we would not
  compile in the poll.h-based async-support. Changed to use the _WIN32
  macro instead. Thanks to Sergei Golubchik for suggesting the fix.
* Fix from Pali Rohár for use-after-free in prepared statements,
  changes to bind logic, and added test 40server_prepare_crash.

2016-10-03 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.037)
* Security release to patch possible buffer overflow in unsafe sprintf with
  variable length. Reported and fixed by Pali Rohár. This vulnerability
  is present in all releases at least back to versions 3.0 of the
  driver, which were released in 2005.
  The CVE identifier for this vulnerability is CVE-2016-1246.

Signed-off-by: Tim Orling <[email protected]>
Signed-off-by: Armin Kuster <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants