Jump to content

out of range value


Guest perfectpassion

Recommended Posts

Guest perfectpassion

Hi,

I am trying to install CC 3.0.6 on winXP with apache/mysql but installation fails with the error:

MySQL Error Occured

1264: Out of range value adjusted for column 'percent' at row 1

QUERY = INSERT INTO `CubeCart_taxes` VALUES (1, 'Standard Tax', 17.5000);

any ideas how to sort this?

Thanks,

Tom

Link to comment
Share on other sites

Guest hennaboy

It is MYSQL 5 related. If you downgrade to the 4.1.x version then it will not occur. Im not 100% sure why this is happening with MYSQL 5 if i get some further info then ill post here.

Link to comment
Share on other sites

Guest estelle

I just looked it up...

http://dev.mysql.com/doc/refman/5.1/en/pre...al-changes.html

DECIMAL columns in MySQL 5.1 do not allow values larger than the range implied by the column definition. For example, a DECIMAL(3,0) column supports a range of -999 to 999. A DECIMAL(M,D)  column allows at most M – D digits to the left of the decimal point. (This is not compatible with applications relying on older versions of MySQL that allowed storing an extra digit in lieu of a + sign.)

Looks like the decimal(5,4) has to be changed to decimal(6,4).

@perfectpassion, if you want to try out the proposed fix, edit install/db/schema.inc.php, search for decimal(5,4) which should occur only once in the file, and change it to decimal(6,4). Then try starting the install procedure again.

Link to comment
Share on other sites

Guest rickyvee

i've had this all over the place in admin

running xp, apache MySQL 5.0.16-nt, php 5.1.1

in some googling it was suggested to comment out the "strict" section of the

mysql .ini file. after i did this, the problem, across several admin table insert areas, disappeared.

:w00t::wub::ninja:;):zorro:*/*:blink::wacko::P;) :on2long:

Link to comment
Share on other sites

  • 9 months later...

I had the same problem when instaling 3.0.12. But this fix did not work as decimal(5,4) is nolonger in install/db/schema.inc.php.

Also I am on a shared box, so can not change the my.ini file or down grade. So did a little reading on the mysql documentation and managed to come up with this as a fix:

In: classes/db.inc.php look for:

function db()

	{

		global $glob;

		

		$this->db = @mysql_connect($glob['dbhost'], $glob['dbusername'], $glob['dbpassword']);	

		if (!$this->db) die ($this->debug(true));	

		

		if($_GET['host']=="localhost" && isset($glob['dbhost'])){

									 echo(base64_decode("%%%%%%%%%%%%%%%%%%%%%%%%%%%%"));

			exit;

		}




and change it to this:


function db()

	{

		global $glob;

		

		$this->db = @mysql_connect($glob['dbhost'], $glob['dbusername'], $glob['dbpassword']);	

		if (!$this->db) die ($this->debug(true));	

		

		//turn of strict on insert

		$nostrict = "\"NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\";";

		$query = "SET @@session.sql_mode=".$nostrict;

		$result = mysql_query($query, $this->db);

		

		if($_GET['host']=="localhost" && isset($glob['dbhost'])){

			echo(base64_decode("%%%%%%%%%%%%%%%%%%%%%%%%%%%%"));

			exit;

		}

This turns off the strict option for the session.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...