V 2.17.0 - dml.mysqili.class.inc [message #7529] |
Sun, 06 December 2020 08:49 |
htManager
Messages: 434 Registered: May 2014
|
Senior Member |
|
|
Hi Tony,
after installing the new version V 2.17.0 I get some fatal errors like this:
Fatal Error: MySQL: Duplicate column name 'created_date' (# 1060)
SQL query: SELECT count(*) FROM (
SELECT * FROM orga_mannschaften_kontakte
LEFT JOIN orga_kontakte ON (orga_kontakte.pool_user_id = orga_mannschaften_kontakte.kontakt_ma_user_id AND orga_kontakte.pool_user_seq_no = orga_mannschaften_kontakte.kontakt_ma_user_seq_no)
WHERE (orga_mannschaften_kontakte.verbaende_art_id= 'LV' AND orga_mannschaften_kontakte.verbaende_kuerzel= 'HV S' AND orga_mannschaften_kontakte.vereine_kuerzel= 'MOSKITOS' AND orga_mannschaften_kontakte.saison_id= '2020/2021' AND orga_mannschaften_kontakte.mannschaften_id= 'DA I') AND orga_mannschaften_kontakte.rdcaccount_id IN ('1', '5')
) AS x
Error in line 682 of file '/var/www/vhosts/mgh-saar.de/includes/dml.mysqli.class.inc'.
Host Info: Localhost via UNIX socketServer Version: 5.5.5-10.1.47-MariaDB-0ubuntu0.18.04.1Client Version: mysqlnd 7.4.13, Character sets - client: utf8mb4, - connection: utf8mb4, - database: utf8mb4, - server: utf8mb4
PHP_SELF: /htmanager/htm/orga_mannschaften_kontakte(list2).php
I checked the database table in the dict table and exported all database tables to PHP once more but still the same result. Is it because of a change in the dml.mysqli.class.inc or do I have to do something special?
Best Regards,
Juergen
|
|
|
Re: V 2.17.0 - dml.mysqili.class.inc [message #7530 is a reply to message #7529] |
Sun, 06 December 2020 12:12 |
AJM
Messages: 2368 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
As the SQL_CALC_FOUND_ROWS query modifier is being deprecated in MySQL 8 (refer to https://dev.mysql.com/doc/refman/8.0/en/information-function s.html#function_found-rows) I have had to perform the count in a separate query. I do this by enclosing the query in the following
SELECT count(*) FROM (
... your query ...
) AS x
If your query starts with 'SELECT *' and joins to one or more other tables, then any column name which appears in more than one table will be flagged as a duplicate. You can get around this by specifying 'SELECT <table>.*' so that it ignores columns on any JOINed tables.
I am surprised that the call to selectAllColumns() within the _sqlAssembleWhere() method of std.table.class.inc did not automatically replace '*' with a full list of column names. This is followed by a call to removeDuplicateFromSelect() which is supposed to remove any duplicate column names and so avoid this issue.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
Re: V 2.17.0 - dml.mysqili.class.inc [message #7533 is a reply to message #7532] |
Mon, 07 December 2020 11:50 |
AJM
Messages: 2368 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
If the popup form is not showing the correct contents of that table then you need to examine the database query that it is constructing and executing.
If you are able to select a record in the popup form, but the wrong record is being loaded in the calling form, then you need to step through with your debugger starting at the _cm_popupReturn() method in the calling form to see what primary key is being returned and what record is being read from that table.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
Re: V 2.17.0 - dml.mysqili.class.inc [message #7536 is a reply to message #7535] |
Wed, 09 December 2020 06:47 |
htManager
Messages: 434 Registered: May 2014
|
Senior Member |
|
|
I have changed my scripts and at the moment everything works fine. Maybe there is/was a problem with the caching?! Anyway, as long as I know that this could cause an error in my environment, I will export to PHP once more and see if this was the root cause.
|
|
|