From 4fb5291fe8fc346e9920766f592d976a8e4c6b68 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Tue, 12 Sep 2023 13:55:04 +0200 Subject: [PATCH] [jOOQ/jOOQ#15574] DefaultOtherBinding shouldn't create string literals for inline values for numeric data types --- .../main/java/org/jooq/impl/DefaultBinding.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/jOOQ/src/main/java/org/jooq/impl/DefaultBinding.java b/jOOQ/src/main/java/org/jooq/impl/DefaultBinding.java index 278722253c..664f827f69 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DefaultBinding.java +++ b/jOOQ/src/main/java/org/jooq/impl/DefaultBinding.java @@ -3810,6 +3810,22 @@ public class DefaultBinding implements Binding { } } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + void sqlInline0(BindingSQLContext ctx, Object value) throws SQLException { + Binding b = binding(DefaultDataType.getDataType( + DEFAULT, (Class) value.getClass(), SQLDataType.OTHER + )); + + if (b instanceof DefaultOtherBinding ) + super.sqlInline0(ctx, value); + else if (b instanceof InternalBinding i) + i.sqlInline0(ctx, value); + else + super.sqlInline0(ctx, value); + } + @Override final void set0(BindingSetSQLOutputContext ctx, Object value) throws SQLException { throw new DataTypeException("Type " + dataType + " is not supported");