Solved

MySQL Version 5, out of range value

Posted on 2006-07-17
3
822 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

759 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

20 Experts available now in Live!

Get 1:1 Help Now