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

Are PreProcessSQL() and PreProcessBindSQL() still needed? #437

Closed
bschmalhofer opened this issue Sep 14, 2020 · 6 comments
Closed

Are PreProcessSQL() and PreProcessBindSQL() still needed? #437

bschmalhofer opened this issue Sep 14, 2020 · 6 comments
Labels
question Further information is requested
Milestone

Comments

@bschmalhofer
Copy link
Contributor

The methods are only defined only for Kernel::System::DB::mysql. The explicitly encode the strings sent via the MySQL database connection. My hunch is that this might no longer be necessary. Needs to be investigated.

@bschmalhofer bschmalhofer added the question Further information is requested label Sep 14, 2020
@bschmalhofer bschmalhofer added this to the OTOBO 10.0.3 milestone Sep 14, 2020
@bschmalhofer bschmalhofer changed the title Is PreProcessSQL() and PreProcessBindSQL() still needed Are PreProcessSQL() and PreProcessBindSQL() still needed? Sep 14, 2020
@bschmalhofer
Copy link
Contributor Author

This is fairly confusing. See perl5-dbi/DBD-mysql#106. According to https://metacpan.org/changes/distribution/DBD-mysql the old buggy version of DBD::mysql was restored in DBD::mysql 4.0.43. This means that the comment in Kernel/System/DB/mysql,pm is obsolete:

da5f5593310 (Martin Gruner    2017-03-13 11:32:41 +0100 106)         # DBD::mysql 4.042+ requires data to be octets, so we encode the data on our own.
da5f5593310 (Martin Gruner    2017-03-13 11:32:41 +0100 107)         #   The mysql_enable_utf8 flag seems to be unusable because it treats ALL data as UTF8 unless
da5f5593310 (Martin Gruner    2017-03-13 11:32:41 +0100 108)         #   it has a custom bind data type like SQL_BLOB.
da5f5593310 (Martin Gruner    2017-03-13 11:32:41 +0100 109)         #
ec15de810d8 (Martin Gruner    2017-03-10 11:41:57 +0100 110)         #   See also https://bugs.otrs.org/show_bug.cgi?id=12677.
ec15de810d8 (Martin Gruner    2017-03-10 11:41:57 +0100 111)         $EncodeObject->EncodeOutput( \$BindRef->[$I] );

My preferred solution is to switch to DBD::MariaDB. See https://metacpan.org/pod/distribution/DBD-MariaDB/lib/DBD/MariaDB.pod#UNICODE-SUPPORT.

One thing that should be done, is to require DBD::mysql 4.0.43+ for OTOBO. This would remove some failure modes.
@svenoe , @StefanRother-OTOBO : Are you OK with requiring minimum version DBD::mysql 4.0.43 ?

@svenoe
Copy link
Contributor

svenoe commented Sep 17, 2020

If DBD::mysql 4.0.43 is available for all supported Distros, this can be removed, and 4.0.43+ can be required. (DBD::mariadb should probably be used longterm.)

@bschmalhofer bschmalhofer modified the milestones: OTOBO 10.0.3, OTOBO 10.1 Sep 18, 2020
@bschmalhofer bschmalhofer modified the milestones: OTOBO 10.1, OTOBO 11.0 Feb 18, 2022
@bschmalhofer
Copy link
Contributor Author

DBD::mysql 4.043 was released more than five years ago. I suppose that this version is now available in the usual LTS Linux distributions.

@daxim
Copy link
Contributor

daxim commented Jul 29, 2022

https://pkgs.org/search/?q=dbd-mysql https://repology.org/project/perl:dbd-mysql

ok/nok distro that is still somehow supported rel. year DBD-mysql version
Debian 9 oldoldstable 2017 4.041
Debian 10 oldstable 2019 4.050
CentOS 7 2014 4.023
CentOS 8 2019 4.046
OpenSUSE 15.3 2021 4.046
Ubuntu 14 2014 4.025
Ubuntu 16 2016 4.033
Ubuntu 18 2018 4.046

@bschmalhofer
Copy link
Contributor Author

Thanks to @daxim for looking that up. So instead of requiring DBD::mysql 4.043 or higher, I'd rather put DBD::mysql 4.042 on the blacklist.

bschmalhofer added a commit that referenced this issue Jul 29, 2022
Because this is the primary use case.
bschmalhofer added a commit that referenced this issue Jul 29, 2022
as this was just a workaround for DBD::mysql 4.042, which is blacklisted now
bschmalhofer added a commit that referenced this issue Jul 29, 2022
@bschmalhofer
Copy link
Contributor Author

DBD::mysql 4.042 is now on the blacklist. The SQL preprocessing has been removed. The test suite looks fine, and a quick sanity test looked fine too. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants