?
Solved

MySQL Version 5, out of range value

Posted on 2006-07-17
3
Medium Priority
?
855 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 35

Accepted Solution

by:
Raynard7 earned 1000 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 1000 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

777 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