From c5172ba72d39c4badc86e1ce53224233e09d10a1 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Tue, 18 Jun 2024 16:57:40 +0200 Subject: [PATCH] Issue #1965 and issue #1088: do not force integer display width when composing CREATE TABLE code on MySQL 8.0.17+. The user may set one if he likes, but that will now show a server warning in the log panel. --- source/dbconnection.pas | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/dbconnection.pas b/source/dbconnection.pas index c2c7849f..92da1999 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -5816,8 +5816,11 @@ begin end; end; dtcInteger: begin - if not ColQuery.IsNull('NUMERIC_PRECISION') then begin - MaxLen := ColQuery.Col('NUMERIC_PRECISION'); + if (not ColQuery.IsNull('NUMERIC_PRECISION')) then begin + if Parameters.IsMySQL(True) and (ServerVersionInt >= 80017) then + // Integer display width is deprecated as of MySQL 8.0.17 + else + MaxLen := ColQuery.Col('NUMERIC_PRECISION'); end; end; dtcReal: begin