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
[4.0] Various adjustments in database driver checks #19989
Conversation
I have tested this item ✅ successfully on 3a51db5 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19989. |
@alikon can you have a postgres look on this one? Thanks. |
At one point I'm pretty sure all that stuff was wrapped in checks. Apparently that got lost along the way too. |
to move forward in the libraries/vendor/joomla/database/Postgresql/PostgresqlDriver.sql we should consider to add /**
* True if the database engine supports UTF-8 Multibyte (utf8mb4) character encoding.
*
* @var boolean
* @since 1.4.0
*/
protected $utf8mb4 = false; and /**
* Determine whether the database engine support the UTF-8 Multibyte (utf8mb4) character encoding.
*
* @return boolean True if the database engine supports UTF-8 Multibyte.
*
* @since __DEPLOY_VERSION__
*/
public function hasUTF8mb4Support()
{
return $this->utf8mb4;
} and in https://github.com/joomla/joomla-cms/blob/4.0-dev/installation/src/Model/DatabaseModel.php#L1190 if($db->hasUTF8mb4Support())
{
$query = $db->convertUtf8mb4QueryToUtf8($query);
} it's becoming to be a long journey .... |
No. The concept of UTF8MB4 is a MySQL specific thing, it doesn't belong in all drivers. At the Framework level this is addressed with |
sorry i'm unfamiliar with 4.x code, i'm just thinking out of loud |
I've done a large share of the work in porting the CMS specific changes to the Framework repo (and internal restructuring for things like prepared statement support), I know some of this better than the back of my hand 😉 |
sounds better ? if ($db instanceof UTF8MB4SupportInterface)
{
if($db->hasUTF8mb4Support())
{
$query = $db->convertUtf8mb4QueryToUtf8($query);
}
/**
* This is a query which was supposed to convert tables to utf8mb4 charset but the server doesn't
* support utf8mb4. Therefore we don't have to run it, it has no effect and it's a mere waste of time.
*/
if (!$db->hasUTF8mb4Support() && stristr($query, 'CONVERT TO CHARACTER SET utf8 '))
{
continue;
}
} |
Rebased and the utf8mb4 stuff wrapped in appropriate checks now (again). |
sorry but it's still not correct for postgresql install look at my previous comment #19989 (comment)
|
My bad, didn't read far enough down the method. Fixed. |
I have tested this item ✅ successfully on 65f1be8 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19989. |
uhmmm |
Global Session |
well, then can you replace all of |
I'll try later, looks like 355 sql files 😨 |
Not 355 files, when i wrote this i was looking J3.9 folder. 😄 @alikon i changed files like u suggested, but i got same problem. |
i can suggest you to open a new issue.... |
Summary of Changes
pdomysql
database type tomysql
pgsql
database type (the PDO PostgreSQL driver) to ensure things map correctly to establishedpostgresql
structures (i.e. SQL schema paths)Testing Instructions
Mostly code review, if someone's running an environment supporting PDO PostgreSQL I think the CMS would actually be installable now (if I'm following the code right it wanted SQL files at
installation/sql/pgsql
and that's not the case), same if you've got extension code floating around that might support PostgreSQL (patch tester would fall under this).