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
Solved

MySQL Version 5, out of range value

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

839 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