Comments (11)
FYI: I have opened a bug against MySQL here, but I still have no way to reproduce or test it myself. https://bugs.mysql.com/bug.php?id=95698
from dbd-mariadb.
I'm closing this issue as this reported problem is on MySQL server, not in DBD::MariaDB driver.
from dbd-mariadb.
use strict;
use warnings;
use feature 'say';
use DBI;
binmode *STDOUT, ':utf8';
my $dbh = DBI->connect("DBI:MariaDB:test");
$dbh->do(q(CREATE TEMPORARY TABLE unicode_json_test(my_json JSON)));
$dbh->do(q(INSERT INTO unicode_json_test SET my_json = JSON_OBJECT('drink', CONVERT(UNHEX('537AC5916CC5916CC3A9') USING utf8mb4))));
say "JSON output: " . $dbh->selectrow_array(q(SELECT my_json FROM unicode_json_test));
say "Server version: " . $dbh->selectrow_array(q(SELECT VERSION()));
say "Driver version: " . $dbh->{Driver}->{Version};
say "DBI version: $DBI::VERSION";
Output is:
JSON output: {"drink": "Szőlőlé"}
Server version: 10.3.10-MariaDB
Driver version: 1.21
DBI version: 1.636
Seems that DBD::MariaDB 1.21 with MariaDB 10.3.10 is working fine. Or is there any problem?
from dbd-mariadb.
And here is another test case with decoding RAW jsons:
use strict;
use warnings;
use DBI;
use Cpanel::JSON::XS;
use feature 'say';
use utf8;
binmode *STDOUT, ':utf8';
my $cjson = Cpanel::JSON::XS->new->allow_nonref;
my $dbh = DBI->connect("DBI:MariaDB:test");
$dbh->do(q(CREATE TEMPORARY TABLE unicode_json_test(my_json JSON)));
$dbh->do(q(INSERT INTO unicode_json_test SET my_json = JSON_OBJECT('drink', 'Szőlőlé')));
say "RAW JSON output: " . $dbh->selectrow_array(q(SELECT my_json FROM unicode_json_test));
say "Decoded drink JSON output: " . $cjson->decode($dbh->selectrow_array(q(SELECT my_json FROM unicode_json_test)))->{drink};
say "RAW JSON field output: " . $dbh->selectrow_array(q(SELECT json_extract(my_json, "$.drink") FROM unicode_json_test));
say "Decoded JSON field output: " . $cjson->decode($dbh->selectrow_array(q(SELECT json_extract(my_json, "$.drink") FROM unicode_json_test)));
say "Server version: " . $dbh->selectrow_array(q(SELECT VERSION()));
say "Driver version: " . $dbh->{Driver}->{Version};
say "DBI version: $DBI::VERSION";
Output is:
RAW JSON output: {"drink": "Szőlőlé"}
Decoded drink JSON output: Szőlőlé
RAW JSON field output: "Szőlőlé"
Decoded JSON field output: Szőlőlé
Server version: 10.3.10-MariaDB
Driver version: 1.21
DBI version: 1.636
So output seems to be correct too.
If there is something wrong let me know. Otherwise I will close this issue as invalid.
from dbd-mariadb.
The test cases were done on MySQL, so perhaps it is a difference between MySQL and MariaDB.
from dbd-mariadb.
Ok, so it depends on a server version? Can you (or anybody else) specify the version which doesn't work, together with the output of the above test cases? Without it, it is impossible to debug this problem (if there really is any).
from dbd-mariadb.
@ViktorNacht specified his test cases were run in MySQL 5.7.22 and 8.0.13
from dbd-mariadb.
See jhthorsen/mojo-mysql#57 (comment) and jhthorsen/mojo-mysql#57 (comment). This is bug in MySQL server. So please report it to the MySQL server bug tracker.
from dbd-mariadb.
@Grinnz: Do you have any response about that reported bug in MySQL bugtracker?
from dbd-mariadb.
I see no sign of life on the side of MySQL since July 10.
from dbd-mariadb.
There's been no response other than confirming the bug so far.
from dbd-mariadb.
Related Issues (20)
- test case fails with mysql 8.0.22 HOT 11
- support for mysql_enable_utf8 HOT 7
- mariadb_st_finish() does not check mariadb_db_async_result() failure
- Add a missing break to 'MYSQL_TYPE_NULL' case in mariadb_st_describe()
- Test failures with MariaDB-10.6.4 + libmariadb3-3.2.3 HOT 9
- BUG? Can't find 'boot_DBD__MariaDB' in Windows/StrawberryPerl using distro DBD::MariaDB HOT 1
- MySQL server has gone away HOT 1
- t/40server_prepare.t fails HOT 3
- DBD-MariaDB-1.22: Build warnings HOT 5
- SIGPIPE ignored, resulting in: "Unable to flush stdout: Broken pipe" HOT 5
- `mariadb_use_result` is broken HOT 13
- BLOB as parameter in execute HOT 2
- As of MySQL 8.0.34 and 8.1.0 's libmysqlclients deprecates MYSQL_OPT_RECONNECT HOT 2
- Replace compile time version detection by runtime version detection
- Test MariaDB 10.5+ and MySQL 8.1+ server versions in Github Actions CI HOT 1
- failed: SSL connection error: Enforcing SSL encryption is not supported HOT 2
- DBD-MariaDB does not check "Active" on database handles when preparing / executing HOT 2
- Passing credentials via options file fails to read password (mariadb_read_default_file) HOT 3
- Options to the driver mysql_enable_utf8mb4 and mysql_enable_utf8 are not recognised HOT 5
- DBD::MariaDB 1.23 not updating cardinality in MariaDB 10.6.5 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbd-mariadb.