mariadb error BIGINT UNSIGNED value is out of range in

waw ada error pada mariadb “BIGINT UNSIGNED value is out of range in” bla bla bla

Bismillah

q> Cek query yang panjangnya minta ampun terus jalankan errornya :
“Data Truncation error occured on a write  of column 0Data was 0 bytes long and 0 bytes were transferred.”

q> Sedangkan log pada aplikasi terdapat pesan error seperti ini :
“BIGINT UNSIGNED value is out of range in ‘(`dtl`.`TOTAL_AMOUNT` – ((`dtl`.`QTY` – `d`.`QTY`) * `dtl`.`TOTAL_AMOUNT`))'”

q> Cek tipe data untuk kolom total_amount  dengan perintah

show create table dtl_jual_part;

ternyata tipe datanya int unsigned,

q> cari referesensi pada stackoverflow mengenai error ini, dapat sumber ini [1]

q> Coba untuk alter table untuk kolom tersebut, menjadi signed

alter table dtl_jual_part modify TOTAL_AMOUNT int(11) DEFAULT NULL;

q> Jalankan lagi aplikasi, waw errornya hilang

sumber [1] : http://stackoverflow.com/questions/5605085/bigint-unsigned-value-is-out-of-range

Alhamdulillah

 

Published by

saifiahmada

Begin a big Process with a bit trying

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s