Full issue description at http://forum.joomla.org/viewtopic.php?f=706&t=912902&p=3377090#p3377090
Category | ⇒ | Installation SQL Updating |
Labels |
Added:
?
|
Labels |
Added:
?
|
Trying to replicate, hitting other errors, but not this one. Using the weblinks package they posted on joomla-extensions/weblinks#193
PHP 5.5.31, 5.6.17, and 7.0.4 w/ PDO MySQL:
Warning
SQLSTATE[HY000]: General error: 1364 Field 'system_data' doesn't have a default value
Package Install: There was an error installing an extension: com_weblinks.zip
OK, let's try the Akeeba 4.5.5 package since that's what the forum user said they had issues with.
PHP 5.5.31, 5.6.17, and 7.0.4 w/ PDO MySQL:
Warning
SQLSTATE[HY000]: General error: 1364 Field 'system_data' doesn't have a default value
So I can't even get current versions of anything installed to test them.
Fine. Switch over to MySQLi and install Akeeba 4.5.4 since the forum user suggested their issue was with updating the extension. Then switch back to PDO MySQL to run the update. Go into the component, hit his "Reload Update Information" button. Now I'm here w/ PHP 5.6.17:
An error has occurred.
HY000 SQLSTATE[HY000]: General error: 1364 Field 'data' doesn't have a default value
I give up. I surely can't install or update extensions with Joomla's core update feature on a PDO MySQL setup, but it sure as hell isn't related to that forum post.
Current staging. Because so much has changed since 3.4.8 it'd be pretty difficult to try and confirm an issue there then trace down whether it's fixed or not.
Which version of mysql are you on? I remember you had issues with other PDO related bug reports which I couldnt replicate on my pdo system with 5.5.42 and php 5.6.10
5.6.29
So i am pretty sure based on all of our previous testing that there is an issue which is specific to the mysql version
I had tested with mysql version 5.5.47 and could not reproduce with weblinks.
I will test soon with lower version which does not support utf8mb4.
Hmm can also not replicate this with PHP 5.6.19 and mysql 5.1.73 on 3.5.0 RC 4 with installing weblinks. The record in the update site table has been added, no errors shown anywhere, also not in php error log file.
Could be this?
MySQL is most likely in STRICT mode. Try running SET GLOBAL sql_mode='' or edit your my.cnf to make sure you aren't setting STRICT_ALL_TABLES or the like.
As of MySQL 5.7.5, the default SQL mode includes STRICT_TRANS_TABLES.
Possibly but then two things:
1) everyone here has run a maximum MySQL version of 5.6 - so it would have to be manually set to on
2) I think it's more likely to be a MySQL client issue rather than server issue - otherwise we would see this issue manifest on mysqli mode which @mbabker doesn't (as far as I understand)
@wilsonge, mysqli driver sets sql_mode mode to '', pdomysql driver doesn't, i think
See https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/database/driver/mysqli.php#L187
Also check the default values on 5.6.6+
http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_sql_mode
@mbabker version is 5.6.29, i.e., 5.6.6+
SELECT @@sql_mode;
STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION
5.5.5 (MariaDB 10.0.24)
SELECT @@sql_mode
(empty)
So that seems to be the problem.
an empty sql_mode needs to be added to pdomysql driver too
Yes and no. Yes in the fact that changing the sql_mode
to the most permissive setting we can guarantees things will work. No in the fact that the value that's trying to be given to the database is technically not valid for the schema but thanks to the loose session settings MySQL will take it.
right, but IMHO you have to options:
1. correct all queries and default values in the database (and you probably will still have issues with extensions) and allow all sql modes
2. or add also the SET SESSION sql_mode = '';
to pdomysql driver like is already in mysql and mysqli drivers.
BTW, can you confirm that changing the pdomysql sql_mode solves the issues?
You do both. The loose settings makes things consistent and makes sure things work, correcting the schema and PHP code to ensure valid values are being generated ensures a valid and consistent dataset across the board. If I'm not mistaken we aren't doing something similar in for PostgreSQL or SQL Server, so something's gotta be working right in those environments.
If I'm not mistaken we aren't doing something similar in for PostgreSQL or SQL Server, so something's gotta be working right in those environments.
or they don't enforce strict modes ... or something like that
You do both. The loose settings makes things consistent and makes sure things work, correcting the schema and PHP code to ensure valid values are being generated ensures a valid and consistent dataset across the board.
Agree.
Add this to the end of the PDO MySQL driver's connect method:
// Set sql_mode to non_strict mode
$this->connection->query("SET @@SESSION.sql_mode = '';");
Now I get the message from the forum.
So you are running 5.6.29, yet Richard with 5.6.19 (presumably with strict mode off else hell would have broken loose for him) gets nothing. So I guess next step is to figure out if it's a server issue specific to a MySQL version or a client issue :/
We also need to go back and fix strict mode issues
I had tested with mysql version 5.5.47 and could not reproduce with weblinks.
not 5.6.19 (that's his php version)
you need to stop going to the pub ... :D
Well. The sql_mode change both fixes and breaks things. Extensions install fine, but none of the update sites are being added to the table. Tried Akeeba, Weblinks, and my own stuff. Nada. Only in Akeeba is that specific error message being displayed for me, but it's not a stack trace you would expect. The error page is getting rendered, then making matters worse the stack trace is on the line where I added the query for the sql_mode change.
that's the error message of the user in the forum
HY000 SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
Right but it's not in a place that's consistent with what the user's saying the error is.
And turning off the debug plugin gets things working again for me.
it seems that are 3 different related things:
1. correct queries and default values in the database where sql_mode strict mode returns errors
2. add also the SET SESSION sql_mode = ''; to pdomysql driver like is already in mysql and mysqli drivers.
3. solve your latest problem that seems to be related to the forum user problem
@mbabker reggarding 3. did you try to add to the pdomysql driver?
$this->connection->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
Reference: http://php.net/manual/en/ref.pdo-mysql.php
Yep, made no difference with that unbuffered query thing.
did you added it before or after the ?
// Set sql_mode to non_strict mode
$this->connection->query("SET @@SESSION.sql_mode = '';");
Before.
ok... i cannot replicate your issue. Maybe another mysql default config changed in your version that is causing that.
and if you add
$this->options['driverOptions'] = array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true);
to the beggining of the pdomysql.php connect
method? in other words add that flag on pdo connect, instead of being set after pdo connect.
Update: corrected the code
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-03-18 23:44:39 |
Closed_By | ⇒ | wilsonge |
Labels |
Removed:
?
|
Hmm, I just tested and cannot reproduce the isue with 3.5.0 RC 4: I could install weblinks with using the PDO driver for mysql, and weblinks has an update site in its manifest, as required for the test, and all worked well.
Is it maybe related to PHP versions? I tested with 7.
Or has it been solved somehow already since 3.4.8 for which the isue was reported?
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9447.