PDOException: SQLSTATE[22003] after entering large value in integer and decimal field

Created on 20 December 2010, almost 14 years ago
Updated 19 February 2024, 7 months ago

Problem/Motivation

Created a field of the type integer called ISBN, without setting anything else but the name. (So no minimum, maximum, default value etc.)

When entering a particularly large value when adding a node, the following message is displayed after hitting the Save button:

Drupal 7 version of the error message:
PDOException: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'field_isbn_publication_value' at row 1: INSERT INTO {field_data_field_isbn_publication} (etid, entity_id, revision_id, bundle, delta, language, field_isbn_publication_value) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => 2 [:db_insert_placeholder_2] => 2 [:db_insert_placeholder_3] => publication [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => es [:db_insert_placeholder_6] => 9070334046 ) in field_sql_storage_field_storage_write() (line 447 of /[...]/modules/field/modules/field_sql_storage/field_sql_storage.module).

Drupal 8 version of the error message:
Drupal\Core\Entity\EntityStorageException: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'field_jtqu3u4e_value' at row 1: INSERT INTO {node__field_jtqu3u4e} (entity_id, revision_id, bundle, delta, langcode, field_jtqu3u4e_value) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => 2 [:db_insert_placeholder_1] => 2 [:db_insert_placeholder_2] => dzpge4ou [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => und [:db_insert_placeholder_5] => 2147483648 ) in Drupal\Core\Entity\FieldableDatabaseStorageController->save() (line 693 of core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php).

Steps to reproduce

  1. Add an integer list field to a content type
  2. Create a node of that content type
  3. Enter a number > 2147483647
  4. Save
  5. Check log for erorrs

Proposed resolution

TBA

Remaining tasks

Issue Summary Update
Review

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
FieldΒ  β†’

Last updated about 11 hours ago

Created by

πŸ‡΅πŸ‡ΉPortugal olafveerman

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024