Solved

MySQL Version 5, out of range value

Posted on 2006-07-17
3
827 Views
Last Modified: 2009-12-16
Hello Experts!

Are there any option to config MySQL 5 that abort out of range value like MySQL4.1..
e.g. in MySQL4.1 I insert to integer field with value of 18446744073709551551, It replace by 2147483647 of limit (not error).
in MySQL 5, It raise error "Out of range value adjusted for column 'aaa' at row 1"

Thanks in advanced!
0
Comment
Question by:HuyBD
3 Comments
 
LVL 35

Accepted Solution

by:
Raynard7 earned 250 total points
ID: 17120521
There is no setting to do this,

I would not advise washing over errors anyway - however in MySql 5 you now have triggers

BEFORE INSERT ON table_name
or AFTER INSERT ON table_name
or BEFORE UPDATE ON table_name
or AFTER UPDATE ON table_name
or BEFORE DELETE ON table_name
or AFTER DELETE ON table_name

What you can do is Before Insert say if the value is > than the integer limit then insert 2147483647 which would work just as well.
0
 
LVL 8

Assisted Solution

by:Yuval_Shohat
Yuval_Shohat earned 250 total points
ID: 17120851
if you need those BIG BIG numbers, I would consider using Decimal(X,Y) insted of Integer and bigint...
Keeping that in mind I'd sugget reading:
http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html
read it to the end, there is some refrance as to how mysql behaves in different modes.

-=Yuval=-
0
 
LVL 17

Author Comment

by:HuyBD
ID: 17127757
Thank both of you!
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
A lot of articles have been written on splitting mysqldump and grabbing the required tables. A long while back, when Shlomi (http://code.openark.org/blog/mysql/on-restoring-a-single-table-from-mysqldump) had suggested a “sed” way, I actually shell …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now