Skip to content

Commit 6ce82db

Browse files
committed
Bug #28204677: Connector charset default utf8mb4
1 parent 04838c9 commit 6ce82db

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

driver/mysql_connection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ void MySQL_Connection::init(ConnectOptionsMap & properties)
425425

426426
sql::SQLString userName;
427427
sql::SQLString password;
428-
sql::SQLString defaultCharset("utf8");
429-
sql::SQLString characterSetResults("utf8");
428+
sql::SQLString defaultCharset("utf8mb4");
429+
sql::SQLString characterSetResults("utf8mb4");
430430

431431
sql::SQLString sslKey, sslCert, sslCA, sslCAPath, sslCipher, postInit;
432432
bool ssl_used = false;

test/unit/bugs/bugs.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,9 +493,6 @@ void bugs::bug71606()
493493
{
494494
logMsg("bugs::bug71606");
495495

496-
//TODO: Enable it after fixing
497-
SKIP("Removed untill fixed");
498-
499496
if (getMySQLVersion(con) < 56000)
500497
{
501498
SKIP("The server does not support tested functionality(utf8mb4 charset)");
@@ -1093,5 +1090,22 @@ void bugs::bug17227390()
10931090
}
10941091
}
10951092

1093+
/* Bug #28204677 - The driver defaults to utf8mb4 */
1094+
void bugs::bug28204677()
1095+
{
1096+
logMsg("bugs::bug71606");
1097+
1098+
if (getMySQLVersion(con) < 57000)
1099+
{
1100+
SKIP("The server does not support tested functionality(default utf8mb4 charset)");
1101+
}
1102+
1103+
res.reset(stmt->executeQuery("SHOW VARIABLES like 'character_set_client'"));
1104+
res->next();
1105+
1106+
ASSERT_EQUALS(res->getString(2),"utf8mb4");
1107+
}
1108+
10961109
} /* namespace regression */
10971110
} /* namespace testsuite */
1111+

test/unit/bugs/bugs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ class bugs : public unit_fixture
137137

138138
void bug17227390();
139139

140+
void bug28204677();
141+
140142
};
141143

142144
REGISTER_FIXTURE(bugs);

0 commit comments

Comments
 (0)