Missing default values in MySQL

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Missing default values in MySQL

Postby computergenius » 07. April 2021 20:50

I have just downloaded the latest version of XAMPP, but I find that some fields, integer, date, etc, are being autofilled with the default values, but an error message is being generated.

example fields - the first one works:
pplID int(11) (NULL) NO PRI (NULL) auto_increment select,insert,update,references
pplmc_gross decimal(7,2) (NULL) NO (NULL) select,insert,update,references
pplcounter int(11) (NULL) NO (NULL) select,insert,update,references

Have I missed something? Do I have to specify all default values now - (and if so, why?)
Last edited by computergenius on 07. April 2021 21:04, edited 1 time in total.
computergenius
 
Posts: 12
Joined: 02. March 2019 13:47
XAMPP version: 3.2.4
Operating System: Windows 10

Re: Missing default values in MySQL

Postby computergenius » 07. April 2021 21:03

I have just realised that the default values ARE being added, but that an error report is being generated:

Warning Code : 1364
Field 'pplmc_gross' doesn't have a default value

pplmc_gross, decimal(7,2), is correctly being entered as 0.00, but giving an error message.
computergenius
 
Posts: 12
Joined: 02. March 2019 13:47
XAMPP version: 3.2.4
Operating System: Windows 10

Re: Missing default values in MySQL

Postby Altrea » 08. April 2021 18:23

I have tried to reproduce your issue, but it is impossible with this amount of information. Please help us to recreate your environment if you want to get this sorted out.
Please create an export of this table containing the table structure and show us the SQL code to recreate that table.
In this phpmyadmin export it should start with the line "CREATE TABLE"
Then please show us the SQL STatement of the failed Insert try.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 10995
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Missing default values in MySQL

Postby computergenius » 09. April 2021 20:03

Ok, more details:

I am using Windows 10 Pro x64.

The installation is from
xampp-windows-x64-7.4.16-0-VC15-installer.exe
It's a new installation, to replace a damaged earlier version. The earlier version was perhaps from Sept or Oct 2020, but I can't be sure.

The example that I have been using is the payments table, "create script" below, which used to be used for PayPal (hence the name).

There are many "implicit" defaults required, for example an int should give a 0, and no error message.

Take the line:
INSERT INTO paypal SET pplcustom = 99999
which just inserts one field, and expects all the others to default.

I have remmed (#) the line in my.ini
#sql_mode=NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_ENGINE_SUBSTITUTION

With the line active in my.ini, I see a list of all the "missing" implicit defaults.
With the line remmed, I only see the first missing implicit default. But my system still reports that there was an error. I need it to insert defaults without error message.
Error Code: 1364
Field '(fieldname)' doesn't have a default value


With the previous version of xampp that I was using, it was working fine, but I can't see what version it was, as it was damaged, and hence the reason for the upgrade to the latest version. So I don't even know which version to go back to.

I need the commands give similar results on the xampp (local, test) version, and the live version. That is, use all implicit defaults.



CREATE TABLE `paypal` (
`pplID` int(11) NOT NULL AUTO_INCREMENT,
`pplmc_gross` decimal(7,2) NOT NULL,
`pplinvoice` char(16) NOT NULL,
`pplsettle_amount` decimal(7,2) NOT NULL DEFAULT 74.00,
`pplprotection_eligibility` char(10) NOT NULL,
`ppladdress_status` char(10) NOT NULL,
`pplpayer_id` char(16) NOT NULL,
`ppladdress_street` text NOT NULL,
`pplpayment_date` char(25) NOT NULL,
`pplunix_date` int(11) DEFAULT NULL,
`ppldate` datetime NOT NULL,
`pplpayment_status` char(12) NOT NULL,
`pplcharset` varchar(20) NOT NULL,
`ppladdress_zip` char(10) NOT NULL,
`pplfirst_name` varchar(20) NOT NULL,
`pplmc_fee` decimal(5,2) NOT NULL,
`ppladdress_country_code` char(3) NOT NULL,
`pplexchange_rate` char(10) NOT NULL,
`ppladdress_name` varchar(40) NOT NULL,
`pplnotify_version` char(5) NOT NULL DEFAULT 'Moka1',
`pplsettle_currency` decimal(7,2) NOT NULL,
`pplcustom` text NOT NULL,
`pplpayer_status` char(12) NOT NULL,
`pplbusiness` varchar(50) NOT NULL,
`ppladdress_country` varchar(20) NOT NULL,
`ppladdress_city` varchar(20) NOT NULL,
`pplquantity` smallint(6) NOT NULL,
`pplverify_sign` char(56) NOT NULL,
`pplpayer_email` varchar(50) NOT NULL,
`ppltxn_id` varchar(20) NOT NULL,
`pplpayment_type` char(10) NOT NULL,
`ppllast_name` varchar(20) NOT NULL,
`ppladdress_state` varchar(30) NOT NULL,
`pplreceiver_email` varchar(50) NOT NULL,
`pplpayment_fee` char(10) NOT NULL,
`pplreceiver_id` varchar(50) NOT NULL,
`ppltxn_type` char(16) NOT NULL,
`pplitem_name` varchar(50) NOT NULL DEFAULT 'CoachMeFree Subscription',
`pplmc_currency` char(3) NOT NULL DEFAULT 'EUR',
`pplitem_number` char(20) NOT NULL,
`pplresidence_country` char(3) NOT NULL,
`ppltransaction_subject` varchar(20) NOT NULL,
`pplpayment_gross` char(10) NOT NULL,
`pplipn_track_id` char(16) NOT NULL,
PRIMARY KEY (`pplID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
computergenius
 
Posts: 12
Joined: 02. March 2019 13:47
XAMPP version: 3.2.4
Operating System: Windows 10

Re: Missing default values in MySQL

Postby computergenius » 12. April 2021 09:31

If anyone is following my thread, I will update you with what I have done. I didn't know how to tell what version of Xampp I was using, so I couldn't re-install an older version - I didn't know which one..

I was comparing the (xampp)/mysql/bin/my.ini from the new version and the crashed version, and they were identical, apart from the window position of the XAMPP Control Panel. I thought perhaps the default version of this file had changed between versions, but it hasn't.

So I was going through other files, comparing, and in one file (xampp)/properties.ini, I found the version number.
[General]
base_stack_version=7.4.11-0

So now I now which version I was using without problems (until it crashed!). This version is not available on the XAMPP site, so I chose the next most recent version, 7.4.16 / PHP 7.4.16, and installed that, in a different folder.

The problem of error reports has now disappeared, although I am using an older version.

But I am still looking for an answer to my original problem, otherwise I could be stuck with this older version forever!
computergenius
 
Posts: 12
Joined: 02. March 2019 13:47
XAMPP version: 3.2.4
Operating System: Windows 10

Re: Missing default values in MySQL

Postby Altrea » 12. April 2021 09:53

I don't know how i can help you.
In your previous post you wrote you are using XAMPP 7.4.16 and that error occured.
Now you wrote you installed XAMPP 7.4.16 again fresh and the error disappeared.

I even cannot reproduce your error.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 10995
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Missing default values in MySQL

Postby computergenius » 13. April 2021 17:02

You are quite correct, I am cracking under the pressure.
I went round in a circle, and ended up with the same version, only this time it works.

Apologies for the confusion.
computergenius
 
Posts: 12
Joined: 02. March 2019 13:47
XAMPP version: 3.2.4
Operating System: Windows 10


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 80 guests