Passing an out of range value to a unsigned integer throws a vague error
See original GitHub issue2020-03-11T13:55:21.617Z prisma-client prisma.lAfOL_block_content_field_data.create({
data: {
changed: -1512,
default_langcode: 440,
id: 4,
info: 'bawha',
langcode: '57e13d34-ca08-5720-b994-69fb4d3a0f81',
reusable: 990,
revision_id: -915,
revision_translation_affected: 159,
status: 1315,
type: 'uhred'
}
})
2020-03-11T13:55:21.617Z prisma-client Generated request:
2020-03-11T13:55:21.617Z prisma-client mutation {
createOnelAfOL_block_content_field_data(data: {
changed: -1512
default_langcode: 440
id: 4
info: "bawha"
langcode: "57e13d34-ca08-5720-b994-69fb4d3a0f81"
reusable: 990
revision_id: -915
revision_translation_affected: 159
status: 1315
type: "uhred"
}) {
changed
default_langcode
id
info
langcode
reusable
revision_id
revision_translation_affected
status
type
}
}
...
Invalid response data: the query result was required, but an empty Object((Weak)) was returned instead.
at PrismaClientFetcher.request (/home/runner/work/introspection-engine-output/introspection-engine-output/clients/mysql_public_test_utils/drupal/runtime/index.js:1:47203)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
model lAfOL_block_content_field_data {
changed Int?
default_langcode Int
id Int
info String?
langcode String
reusable Int?
revision_id Int
revision_translation_affected Int?
status Int
type String
@@id([id, langcode])
@@index([id, default_langcode, langcode], name: "block_content__id__default_langcode__langcode")
@@index([revision_id], name: "block_content__revision_id")
@@index([status, type, id], name: "block_content__status_type")
@@index([type], name: "block_content_field__type__target_id")
}
CREATE TABLE `lAfOL_block_content_field_data` (
`id` int(10) unsigned NOT NULL,
`revision_id` int(10) unsigned NOT NULL,
`type` varchar(32) CHARACTER SET ascii NOT NULL COMMENT 'The ID of the target entity.',
`langcode` varchar(12) CHARACTER SET ascii NOT NULL,
`status` tinyint(4) NOT NULL,
`info` varchar(255) DEFAULT NULL,
`changed` int(11) DEFAULT NULL,
`reusable` tinyint(4) DEFAULT NULL,
`default_langcode` tinyint(4) NOT NULL,
`revision_translation_affected` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`id`,`langcode`),
KEY `block_content__id__default_langcode__langcode` (`id`,`default_langcode`,`langcode`),
KEY `block_content__revision_id` (`revision_id`),
KEY `block_content_field__type__target_id` (`type`),
KEY `block_content__status_type` (`status`,`type`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='The data table for block_content entities.';
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
unsigned long int accepts out of range values - Stack Overflow
1 Answer 1 ... It looks like you're trying to ensure that the user doesn't type too big a value for your seconds...
Read more >Should you throw an exception if a method's input values are ...
Yes, I believe you should throw an exception, to help your fellow programmers notice the error at compile-time, by also adding throws ...
Read more >unsigned vs signed - Is Bjarne Mistaken? - Google Groups
>positive values are passed to it. It does just the opposite: it hides the fact that a negative number has been passed. So...
Read more >C++ unsigned int | Optimizing and Manipulating with Bits
If the user tries to store a value more than that of the defined range, then it experiences some errors as unsigned integers...
Read more >C++ Core Guidelines - GitHub Pages
The C++ Core Guidelines are a set of tried-and-true guidelines, rules, and best practices about coding in C++.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@janpio Postgres doesn’t have a concept of unsigned integer (ref https://stackoverflow.com/questions/2991405/what-is-the-difference-between-tinyint-smallint-mediumint-bigint-and-int-in-m)
Integration tests have been added for these with (https://github.com/prisma/prisma/pull/3683) in (https://github.com/prisma/prisma/commit/cd8361cf5a1e4c8786f40075db9888e188e701c1#diff-6e4bbddeca93b81ae24c82eaef9bbf5e)