[jOOQ/jOOQ#18047] Include fields and values lengths in "The number of values must match the number of fields" error message

This commit is contained in:
Lukas Eder 2025-02-26 10:54:31 +01:00
parent e19cd25b67
commit 33713718c2

View File

@ -815,7 +815,7 @@ final class InsertImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10
// [#4629] Plain SQL INSERT INTO t VALUES (a, b, c) statements don't know the insert columns
else if (!Tools.isEmpty(fields) && fields.length != values.length)
throw new IllegalArgumentException("The number of values must match the number of fields");
throw new IllegalArgumentException("The number of values (" + values.length + ") must match the number of fields (" + fields.length + ")");
getDelegate().newRecord();
if (Tools.isEmpty(fields))
@ -969,7 +969,7 @@ final class InsertImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10
// [#4629] Plain SQL INSERT INTO t VALUES (a, b, c) statements don't know the insert columns
else if (!Tools.isEmpty(fields) && fields.length != values.length)
throw new IllegalArgumentException("The number of values must match the number of fields");
throw new IllegalArgumentException("The number of values (" + values.length + ") must match the number of fields (" + fields.length + ")");
getDelegate().newRecord();