Skip to content

Instantly share code, notes, and snippets.

@Caffe1neAdd1ct
Created November 9, 2020 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Caffe1neAdd1ct/4a9004327390140bf10e3af2f277077f to your computer and use it in GitHub Desktop.
Save Caffe1neAdd1ct/4a9004327390140bf10e3af2f277077f to your computer and use it in GitHub Desktop.
PHP 5.6 Patches for aur build mysqlnd bug
diff --git a/php-mysqlnd-fix.patch b/php-mysqlnd-fix.patch
new file mode 100644
index 0000000..1cadcb3
--- /dev/null
+++ b/php-mysqlnd-fix.patch
@@ -0,0 +1,22 @@
+--- a/ext/mysqlnd/mysqlnd_ps_codec.c 2019-01-09 09:54:13.000000000 +0000
++++ b/ext/mysqlnd/mysqlnd_ps_codec.c 2020-11-05 15:21:00.238585270 +0000
+@@ -911,7 +911,7 @@
+ zend_uchar *p = stmt->execute_cmd_buffer.buffer,
+ *cmd_buffer = stmt->execute_cmd_buffer.buffer;
+ size_t cmd_buffer_length = stmt->execute_cmd_buffer.length;
+- enum_func_status ret;
++ enum_func_status ret = PASS;
+
+ DBG_ENTER("mysqlnd_stmt_execute_generate_request");
+
+@@ -928,7 +928,9 @@
+ int1store(p, 1); /* and send 1 for iteration count */
+ p+= 4;
+
+- ret = mysqlnd_stmt_execute_store_params(s, &cmd_buffer, &p, &cmd_buffer_length TSRMLS_CC);
++ if (stmt->param_count != 0) {
++ ret = mysqlnd_stmt_execute_store_params(s, &cmd_buffer, &p, &cmd_buffer_length TSRMLS_CC);
++ }
+
+ *free_buffer = (cmd_buffer != stmt->execute_cmd_buffer.buffer);
+ *request_len = (p - cmd_buffer);
diff --git a/PKGBUILD b/PKGBUILD
index 17f4410..9f3a90c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -47,6 +47,7 @@ source=("https://secure.php.net/distributions/${_pkgbase}-${pkgver}.tar.xz"
'php.ini.patch' 'apache.conf' 'php-fpm.conf.in.patch'
'logrotate.d.php-fpm' 'php-fpm.service' 'php-fpm.tmpfiles'
'use-enchant2.patch'
+ 'php-mysqlnd-fix.patch'
'php-freetype-2.9.1.patch')
sha512sums=('997b5a952a60cf9166671cc91fcc34c674dd62bfd5cb0a9cdf3fdf2d088b5d19943d94c1cf193f8ab71fc4957d9a9a4c7c2fb8826f937501c1c0a0858f10e329'
'SKIP'
@@ -57,6 +58,7 @@ sha512sums=('997b5a952a60cf9166671cc91fcc34c674dd62bfd5cb0a9cdf3fdf2d088b5d19943
'c6b74e1b39224e79d33915a0d32fe2d08114d1dcec93035017af783b8b73b6475779e3e649abb35b73ea2fd6553120696c48ebb0894531282fbc9e1b36da9f3b'
'9cc548c9395f0765e6ebf54604dc8e71da38ffbc10eba50ba9b7e2f91690c53056f62efa2060fc8670de94e0642027c6eaa6c2820ba99e2b489695d1e320fcf3'
'9fa342db6530bf1b6c86d6eb5020f86eab08b7c134d649291755d3b8356837509ac9dd8a8c8a26a7c98468045abcb128bdf9cc7c6646ccf06da43909aa7b019b'
+ '14720eff3bc90106c6740017344e01f678090c4b07dd4ba5d91d65b194829032a0e458f333f8c14e12279a5e0f526de9792e43f22eb2a2db48285e34a2e148e2'
'0a06189f6fb3513cd2dcf9ddb590360475e2dd9a7aa8b13ab66c389c1ed40ce2361681f017cd3c6219f5b40a0a9d4978e57ca3ee4bacb7657db3285136fd2875')
validpgpkeys=('6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3'
'0BD78B5F97500D450838F95DFE857D9A90D90EC1')
@@ -81,6 +83,11 @@ prepare() {
# kudos to Brian Evans <grknight@gentoo.org>
# https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-lang/php/files/php-freetype-2.9.1.patch
patch -p1 -N -l -i "${srcdir}/php-freetype-2.9.1.patch"
+
+ # fix mysqlnd compat with mariadb versions
+ # stricter packet checking introduced where php is sending a byte to indicate prepared params and not sending any params
+ # https://raw.githubusercontent.com/centminmod/centminmod/123.09beta01/patches/php/php5640-mysqlnd-fix.patch
+ patch -p1 -N -l -i "${srcdir}/php-mysqlnd-fix.patch"
}
build() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment