Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  ps_innodb.test  Sprache: unbekannt

 
Spracherkennung für: .test vermutete Sprache: SQL {SQL[132] VDM[66] Lisp[58]} [Methode: maximale Elemente, drei Dimensionen]

--source include/have_innodb.inc

--echo #
--echo # MDEV-17042: prepared statement does not return error with
--echo # SQL_MODE STRICT_TRANS_TABLES. (Part 2)
--echo #

set @save_sql_mode=@@sql_mode;
set sql_mode='STRICT_TRANS_TABLES';

CREATE TABLE t1 (id int, count int) engine=innodb;
insert into t1 values (1,1),(0,2);
--error ER_TRUNCATED_WRONG_VALUE
update t1 set count = count + 1 where id = '1bad';

prepare stmt from "update t1 set count = count + 1 where id = '1bad'";
--error ER_TRUNCATED_WRONG_VALUE
execute stmt;
deallocate prepare stmt;

prepare stmt from 'update t1 set count = count + 1 where id = ?';
set @a = '1bad';
--error ER_TRUNCATED_WRONG_VALUE
execute stmt using @a;
deallocate prepare stmt;
drop table t1;

CREATE TABLE t1 (id decimal(10,5), count int) engine=innodb;
insert into t1 values (1,1),(0,2);
--error ER_TRUNCATED_WRONG_VALUE
update t1 set count = count + 1 where id = '1bad';

prepare stmt from "update t1 set count = count + 1 where id = '1bad'";
--error ER_TRUNCATED_WRONG_VALUE
execute stmt;
deallocate prepare stmt;

prepare stmt from 'update t1 set count = count + 1 where id = ?';
set @a = '1bad';
--error ER_TRUNCATED_WRONG_VALUE
execute stmt using @a;
deallocate prepare stmt;
drop table t1;

CREATE TABLE t1 (id double, count int) engine=innodb;
insert into t1 values (1,1),(0,2);
--error ER_TRUNCATED_WRONG_VALUE
update t1 set count = count + 1 where id = '1bad';

prepare stmt from "update t1 set count = count + 1 where id = '1bad'";
--error ER_TRUNCATED_WRONG_VALUE
execute stmt;
deallocate prepare stmt;

prepare stmt from 'update t1 set count = count + 1 where id = ?';
set @a = '1bad';
--error ER_TRUNCATED_WRONG_VALUE
execute stmt using @a;
deallocate prepare stmt;
drop table t1;

CREATE TABLE t1 (id date, count int) engine=innodb;
insert into t1 values ("2019-06-11",1),("2019-06-12",2);
--error ER_TRUNCATED_WRONG_VALUE
update t1 set count = count + 1 where id = '1bad';

prepare stmt from "update t1 set count = count + 1 where id = '1bad'";
--error ER_TRUNCATED_WRONG_VALUE
execute stmt;
deallocate prepare stmt;

prepare stmt from 'update t1 set count = count + 1 where id = ?';
set @a = '1bad';
--error ER_TRUNCATED_WRONG_VALUE
execute stmt using @a;
deallocate prepare stmt;
drop table t1;
set sql_mode=@save_sql_mode;

--echo # End of 5.5 tests

[Dauer der Verarbeitung: 0.7 Sekunden, vorverarbeitet 2026-10-08]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1126438
#Domains=1867298