Used by
HeidiSQL.
MySql 5.7 x64

When adding (updating) an entry in the TINYINT (or INT) field.
Numbers are added: 100, 150 ..

The error "0 rows update when that should have 1" appears

CREATE TABLE `tst_001_tb_00` ( `id` INT(11) NOT NULL, `pl_1_txt` TEXT NULL, `update_pl_2` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `pl_2_enum` ENUM('Y','N') NULL DEFAULT NULL, `update_pl_3` DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `pl_3_txt` TEXT NULL, `pl_tinyint` TINYINT(4) NULL DEFAULT NULL, `pl_int` INT(11) NULL DEFAULT NULL, INDEX `id` (`id`) ) COLLATE='utf8_general_ci' ENGINE=InnoDB ; 

Question.
What is the problem?

Screen enter image description here

  • one
    @Mike Made changes to the table: 1. renamed the TINYINT field to pl_tinyint , and the INT field to pl_int . 2. Changed the length of the pl_tinyint field from "10" to "4". Just changing the number in the table. And changes are not made. An error message appears, see the screen at the link prntscr.com/edkfn5 And the error pops up once. Once the value is entered, and then gives an error. Fulfilling the request through the command everything works fine, see the screen ... prntscr.com/edkg5n . The field is supposed to place the numbers in the specified range. - koverflow
  • @Mike Added primary key , it all worked. For now at least. Mike, make out probably as an answer ... - koverflow
  • @Mike Added, check - koverflow

1 answer 1

Most development environments cannot update data in a table unless they can understand how to uniquely identify a record. Your table is missing a primary key (primary key) because of this update and does not pass.