Skip to content

Commit 16dab35

Browse files
committed
chore: update tests for value out of range errors
1 parent 3293398 commit 16dab35

6 files changed

Lines changed: 29 additions & 37 deletions

File tree

  • libs/user-facing-errors/src/query_engine
  • query-compiler/query-engine-tests-todo
  • query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions

libs/user-facing-errors/src/query_engine/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pub struct InputError {
200200
}
201201

202202
#[derive(Debug, UserFacingError, Serialize)]
203-
#[user_facing(code = "P2020", message = "Value out of range for the type. {details}")]
203+
#[user_facing(code = "P2020", message = "Value out of range for the type: {details}")]
204204
pub struct ValueOutOfRange {
205205
pub details: String,
206206
}

query-compiler/query-engine-tests-todo/pg-cockroachdb/fail/join

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
new::regressions::max_integer::max_integer::unfitted_int_should_fail
2-
new::regressions::max_integer::max_integer::unfitted_int_should_fail_pg_js
31
new::regressions::prisma_13097::prisma_13097::group_by_boolean_array
42
new::regressions::prisma_13097::prisma_13097::group_by_enum_array
53
new::regressions::prisma_7434::not_in_chunking_cockroachdb::not_in_batch_filter

query-compiler/query-engine-tests-todo/pg-cockroachdb/fail/query

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
new::regressions::max_integer::max_integer::unfitted_int_should_fail
2-
new::regressions::max_integer::max_integer::unfitted_int_should_fail_pg_js
31
new::regressions::prisma_13097::prisma_13097::group_by_boolean_array
42
new::regressions::prisma_13097::prisma_13097::group_by_enum_array
53
new::regressions::prisma_7434::not_in_chunking_cockroachdb::not_in_batch_filter

query-compiler/query-engine-tests-todo/pg/fail/join

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
new::regressions::max_integer::max_integer::unfitted_int_should_fail
2-
new::regressions::max_integer::max_integer::unfitted_int_should_fail_pg_js
31
new::regressions::prisma_13097::prisma_13097::group_by_boolean_array
42
new::regressions::prisma_13097::prisma_13097::group_by_enum_array
53
new::regressions::prisma_7434::not_in_chunking::not_in_batch_filter

query-compiler/query-engine-tests-todo/pg/fail/query

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
new::regressions::max_integer::max_integer::unfitted_int_should_fail
2-
new::regressions::max_integer::max_integer::unfitted_int_should_fail_pg_js
31
new::regressions::prisma_13097::prisma_13097::group_by_boolean_array
42
new::regressions::prisma_13097::prisma_13097::group_by_enum_array
53
new::regressions::prisma_7434::not_in_chunking::not_in_batch_filter

query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/max_integer.rs

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -254,36 +254,36 @@ mod max_integer {
254254
assert_error!(
255255
runner,
256256
format!("mutation {{ createOneTest(data: {{ int: {I32_OVERFLOW_MAX} }}) {{ id }} }}"),
257-
None,
258-
"value \\\"2147483648\\\" is out of range for type integer"
257+
2020,
258+
r#"Value out of range for the type: value "2147483648" is out of range for type integer"#
259259
);
260260
assert_error!(
261261
runner,
262262
format!("mutation {{ createOneTest(data: {{ int: {I32_OVERFLOW_MIN} }}) {{ id }} }}"),
263-
None,
264-
"value \\\"-2147483649\\\" is out of range for type integer"
263+
2020,
264+
r#"Value out of range for the type: value "-2147483649" is out of range for type integer"#
265265
);
266266

267267
// smallint
268268
assert_error!(
269269
runner,
270270
format!("mutation {{ createOneTest(data: {{ smallint: {I16_OVERFLOW_MAX} }}) {{ id }} }}"),
271-
None,
272-
"value \\\"32768\\\" is out of range for type smallint"
271+
2020,
272+
r#"Value out of range for the type: value "32768" is out of range for type smallint"#
273273
);
274274
assert_error!(
275275
runner,
276276
format!("mutation {{ createOneTest(data: {{ smallint: {I16_OVERFLOW_MIN} }}) {{ id }} }}"),
277-
None,
278-
"value \\\"-32769\\\" is out of range for type smallint"
277+
2020,
278+
r#"Value out of range for the type: value "-32769" is out of range for type smallint"#
279279
);
280280

281281
//oid
282282
assert_error!(
283283
runner,
284284
format!("mutation {{ createOneTest(data: {{ oid: {U32_OVERFLOW_MAX} }}) {{ id }} }}"),
285-
None,
286-
"value \\\"4294967296\\\" is out of range for type oid"
285+
2020,
286+
r#"Value out of range for the type: value "4294967296" is out of range for type oid"#
287287
);
288288

289289
// The underlying driver swallows a negative id by interpreting it as unsigned.
@@ -358,55 +358,55 @@ mod max_integer {
358358
runner,
359359
format!("mutation {{ createOneTest(data: {{ tinyint: {I8_OVERFLOW_MAX} }}) {{ id }} }}"),
360360
2020,
361-
"Value out of range for the type. Out of range value for column 'tinyint'"
361+
"Value out of range for the type: Out of range value for column 'tinyint'"
362362
);
363363
assert_error!(
364364
runner,
365365
format!("mutation {{ createOneTest(data: {{ tinyint: {I8_OVERFLOW_MIN} }}) {{ id }} }}"),
366366
2020,
367-
"Value out of range for the type. Out of range value for column 'tinyint'"
367+
"Value out of range for the type: Out of range value for column 'tinyint'"
368368
);
369369

370370
// smallint
371371
assert_error!(
372372
runner,
373373
format!("mutation {{ createOneTest(data: {{ smallint: {I16_OVERFLOW_MAX} }}) {{ id }} }}"),
374374
2020,
375-
"Value out of range for the type. Out of range value for column 'smallint'"
375+
"Value out of range for the type: Out of range value for column 'smallint'"
376376
);
377377
assert_error!(
378378
runner,
379379
format!("mutation {{ createOneTest(data: {{ smallint: {I16_OVERFLOW_MIN} }}) {{ id }} }}"),
380380
2020,
381-
"Value out of range for the type. Out of range value for column 'smallint'"
381+
"Value out of range for the type: Out of range value for column 'smallint'"
382382
);
383383

384384
// mediumint
385385
assert_error!(
386386
runner,
387387
format!("mutation {{ createOneTest(data: {{ mediumint: {I24_OVERFLOW_MAX} }}) {{ id }} }}"),
388388
2020,
389-
"Value out of range for the type. Out of range value for column 'mediumint'"
389+
"Value out of range for the type: Out of range value for column 'mediumint'"
390390
);
391391
assert_error!(
392392
runner,
393393
format!("mutation {{ createOneTest(data: {{ mediumint: {I24_OVERFLOW_MIN} }}) {{ id }} }}"),
394394
2020,
395-
"Value out of range for the type. Out of range value for column 'mediumint'"
395+
"Value out of range for the type: Out of range value for column 'mediumint'"
396396
);
397397

398398
// int
399399
assert_error!(
400400
runner,
401401
format!("mutation {{ createOneTest(data: {{ int: {I32_OVERFLOW_MAX} }}) {{ id }} }}"),
402402
2020,
403-
"Value out of range for the type. Out of range value for column 'int'"
403+
"Value out of range for the type: Out of range value for column 'int'"
404404
);
405405
assert_error!(
406406
runner,
407407
format!("mutation {{ createOneTest(data: {{ int: {I32_OVERFLOW_MIN} }}) {{ id }} }}"),
408408
2020,
409-
"Value out of range for the type. Out of range value for column 'int'"
409+
"Value out of range for the type: Out of range value for column 'int'"
410410
);
411411

412412
// year
@@ -415,69 +415,69 @@ mod max_integer {
415415
runner,
416416
format!("mutation {{ createOneTest(data: {{ year: {} }}) {{ id }} }}", 2156),
417417
2020,
418-
"Value out of range for the type. Out of range value for column 'year'"
418+
"Value out of range for the type: Out of range value for column 'year'"
419419
);
420420
assert_error!(
421421
runner,
422422
format!("mutation {{ createOneTest(data: {{ year: {} }}) {{ id }} }}", 1900),
423423
2020,
424-
"Value out of range for the type. Out of range value for column 'year'"
424+
"Value out of range for the type: Out of range value for column 'year'"
425425
);
426426

427427
// unsigned tinyint
428428
assert_error!(
429429
runner,
430430
format!("mutation {{ createOneTest(data: {{ unsigned_tinyint: {U8_OVERFLOW_MAX} }}) {{ id }} }}"),
431431
2020,
432-
"Value out of range for the type. Out of range value for column 'unsigned_tinyint'"
432+
"Value out of range for the type: Out of range value for column 'unsigned_tinyint'"
433433
);
434434
assert_error!(
435435
runner,
436436
format!("mutation {{ createOneTest(data: {{ unsigned_tinyint: {OVERFLOW_MIN} }}) {{ id }} }}"),
437437
2020,
438-
"Value out of range for the type. Out of range value for column 'unsigned_tinyint'"
438+
"Value out of range for the type: Out of range value for column 'unsigned_tinyint'"
439439
);
440440

441441
// unsigned smallint
442442
assert_error!(
443443
runner,
444444
format!("mutation {{ createOneTest(data: {{ unsigned_smallint: {U16_OVERFLOW_MAX} }}) {{ id }} }}"),
445445
2020,
446-
"Value out of range for the type. Out of range value for column 'unsigned_smallint'"
446+
"Value out of range for the type: Out of range value for column 'unsigned_smallint'"
447447
);
448448
assert_error!(
449449
runner,
450450
format!("mutation {{ createOneTest(data: {{ unsigned_smallint: {OVERFLOW_MIN} }}) {{ id }} }}"),
451451
2020,
452-
"Value out of range for the type. Out of range value for column 'unsigned_smallint'"
452+
"Value out of range for the type: Out of range value for column 'unsigned_smallint'"
453453
);
454454

455455
// unsigned mediumint
456456
assert_error!(
457457
runner,
458458
format!("mutation {{ createOneTest(data: {{ unsigned_mediumint: {U24_OVERFLOW_MAX} }}) {{ id }} }}"),
459459
2020,
460-
"Value out of range for the type. Out of range value for column 'unsigned_mediumint'"
460+
"Value out of range for the type: Out of range value for column 'unsigned_mediumint'"
461461
);
462462
assert_error!(
463463
runner,
464464
format!("mutation {{ createOneTest(data: {{ unsigned_mediumint: {OVERFLOW_MIN} }}) {{ id }} }}"),
465465
2020,
466-
"Value out of range for the type. Out of range value for column 'unsigned_mediumint'"
466+
"Value out of range for the type: Out of range value for column 'unsigned_mediumint'"
467467
);
468468

469469
// unsigned int
470470
assert_error!(
471471
runner,
472472
format!("mutation {{ createOneTest(data: {{ unsigned_int: {U32_OVERFLOW_MAX} }}) {{ id }} }}"),
473473
2020,
474-
"Value out of range for the type. Out of range value for column 'unsigned_int'"
474+
"Value out of range for the type: Out of range value for column 'unsigned_int'"
475475
);
476476
assert_error!(
477477
runner,
478478
format!("mutation {{ createOneTest(data: {{ unsigned_int: {OVERFLOW_MIN} }}) {{ id }} }}"),
479479
2020,
480-
"Value out of range for the type. Out of range value for column 'unsigned_int'"
480+
"Value out of range for the type: Out of range value for column 'unsigned_int'"
481481
);
482482

483483
Ok(())

0 commit comments

Comments
 (0)