@@ -255,7 +255,7 @@ var ScriptTests = []ScriptTest{
255255 },
256256 ExpectedWarning : mysql .ERTruncatedWrongValue ,
257257 ExpectedWarningsCount : 1 ,
258- ExpectedWarningMessageSubstring : "Truncated incorrect DOUBLE value" ,
258+ ExpectedWarningMessageSubstring : fmt . Sprintf ( sql . ErrTruncatedIncorrect . Message , types . Float64 . String (), "123abc" ) ,
259259 },
260260 {
261261 Query : "SELECT TRUNCATE('1.5abc',1)" ,
@@ -264,7 +264,7 @@ var ScriptTests = []ScriptTest{
264264 },
265265 ExpectedWarning : mysql .ERTruncatedWrongValue ,
266266 ExpectedWarningsCount : 1 ,
267- ExpectedWarningMessageSubstring : "Truncated incorrect DOUBLE value" ,
267+ ExpectedWarningMessageSubstring : fmt . Sprintf ( sql . ErrTruncatedIncorrect . Message , types . Float64 . String (), "1.5abc" ) ,
268268 },
269269 {
270270 Query : "SELECT TRUNCATE('999xyz',2)" ,
@@ -273,7 +273,7 @@ var ScriptTests = []ScriptTest{
273273 },
274274 ExpectedWarning : mysql .ERTruncatedWrongValue ,
275275 ExpectedWarningsCount : 1 ,
276- ExpectedWarningMessageSubstring : "Truncated incorrect DOUBLE value" ,
276+ ExpectedWarningMessageSubstring : fmt . Sprintf ( sql . ErrTruncatedIncorrect . Message , types . Float64 . String (), "999xyz" ) ,
277277 },
278278 {
279279 Query : "SELECT TRUNCATE(1.223,'1.5abc')" ,
@@ -282,7 +282,7 @@ var ScriptTests = []ScriptTest{
282282 },
283283 ExpectedWarning : mysql .ERTruncatedWrongValue ,
284284 ExpectedWarningsCount : 2 , // Both input and precision conversions generate warnings
285- ExpectedWarningMessageSubstring : "Truncated incorrect int value" ,
285+ ExpectedWarningMessageSubstring : fmt . Sprintf ( sql . ErrTruncatedIncorrect . Message , types . Int32 . String (), "1.5abc" ) ,
286286 },
287287 {
288288 Query : "SELECT TRUNCATE(1.223,'0.5')" ,
@@ -291,7 +291,7 @@ var ScriptTests = []ScriptTest{
291291 },
292292 ExpectedWarning : mysql .ERTruncatedWrongValue ,
293293 ExpectedWarningsCount : 2 , // Both input and precision conversions generate warnings
294- ExpectedWarningMessageSubstring : "Truncated incorrect int value" ,
294+ ExpectedWarningMessageSubstring : fmt . Sprintf ( sql . ErrTruncatedIncorrect . Message , types . Int32 . String (), "0.5" ) ,
295295 },
296296 {
297297 Query : "SELECT TRUNCATE(1.223,'2.7')" ,
@@ -300,7 +300,7 @@ var ScriptTests = []ScriptTest{
300300 },
301301 ExpectedWarning : mysql .ERTruncatedWrongValue ,
302302 ExpectedWarningsCount : 2 , // Both input and precision conversions generate warnings
303- ExpectedWarningMessageSubstring : "Truncated incorrect int value" ,
303+ ExpectedWarningMessageSubstring : fmt . Sprintf ( sql . ErrTruncatedIncorrect . Message , types . Int32 . String (), "2.7" ) ,
304304 },
305305 {
306306 Query : "SELECT TRUNCATE(1.223,'invalid_precision')" ,
@@ -309,7 +309,7 @@ var ScriptTests = []ScriptTest{
309309 },
310310 ExpectedWarning : mysql .ERTruncatedWrongValue ,
311311 ExpectedWarningsCount : 2 , // Both input and precision conversions generate warnings
312- ExpectedWarningMessageSubstring : "Truncated incorrect int value" ,
312+ ExpectedWarningMessageSubstring : fmt . Sprintf ( sql . ErrTruncatedIncorrect . Message , types . Int32 . String (), "invalid_precision" ) ,
313313 },
314314 {
315315 Query : "SELECT TRUNCATE()" ,
0 commit comments