Skip to content

Commit aabe034

Browse files
committed
fix: use newer/renumbered MYSQL_* constants with libmysql v8+
Refs #2587
1 parent 81ae758 commit aabe034

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

source/dbstructures.mysql.pas

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3185,8 +3185,10 @@ constructor TMySQLLib.Create(UsedDllFile, HintDefaultDll: String);
31853185
end
31863186
else begin
31873187
LibMajorVer := String(mysql_get_client_info);
3188-
if LibMajorVer.StartsWith('8.') or LibMajorVer.StartsWith('9.') then begin
3188+
LibMajorVer := Copy(LibMajorVer, 1, Pos('.', LibMajorVer)-1);
3189+
if StrToIntDef(LibMajorVer, 0) >= 8 then begin
31893190
// Some constants were removed in MySQL 8.0, so the offsets differ
3191+
// This also covers MySQL 9.x "Innovation" releases, which kept the same offsets as 8.x.
31903192
MYSQL_PLUGIN_DIR := 16;
31913193
MYSQL_OPT_SSL_KEY := 19;
31923194
MYSQL_OPT_SSL_CERT := 20;

0 commit comments

Comments
 (0)