Skip to content

Add hack to force mysqlnd extension to be loaded first to avoid missing symbol errors. #9822

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -3060,6 +3060,35 @@ function settings2array(array $settings, &$ini_settings): void
}
}
}

// When both mysqlnd and either of mysqli or pdo_msqli are compiled
// as shared extensions, mysqlnd.so needs to be loaded before either
// of mysqli or pdo_msqli are loaded, as otherwise they will complain
// about missing symbols.
// The same limitation exists for the pdo extension before the
// pdo drivers (pdo_xxx)
if (array_key_exists('extension', $ini_settings) === true) {
$priority_extension_names = [
"mysqlnd.so",
"pdo.so"
];

$priority_extensions = [];
// Strip out the priority extensions
foreach ($priority_extension_names as $priority_extension_name) {
$found_index = array_search($priority_extension_name, $ini_settings['extension']);
if ($found_index !== false) {
$priority_extensions[] = $ini_settings['extension'][$found_index];
unset($ini_settings['extension'][$found_index]);
}
}

// Put the priority extensions first, then the remaining extensions
$ini_settings['extension'] = array_merge(
$priority_extensions,
$ini_settings['extension']
);
}
}

function settings2params(array $ini_settings): string
Expand Down