Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid ignore SQL statement after comments starting by # #9137

Merged
merged 1 commit into from
Feb 17, 2016
Merged

Avoid ignore SQL statement after comments starting by # #9137

merged 1 commit into from
Feb 17, 2016

Conversation

jsanchezgr
Copy link

Description

When you try to install a component with some comments starting by # in SQL files, the following statement is ignored. This PR solves the issue #9008 by deleting all the comments starting by #

How to test

  1. Install latest staging.
  2. Get a component package ready to install.
  3. Unzip the component and edit administrator/sql/install.mysql.utf8.sql file by adding some comments starting by #
  4. Zip your component again and then install. The component is installed ok, but the following SQL statements to comments will be omited and may cause some errors in your component.
  5. Uninstall the component.
  6. Apply this patch.
  7. Repeat steps 2 to 4.
  8. Now the installer is working right.

… #, the following statement will be ignored.

This commit fix the issue #9008 by removing all the lines starting by # in the SQL files.
@brianteeman
Copy link
Contributor

I couldnt repeat the issue so have not been able to test the patch

I followed all the steps above and in step 3 I added the following at the very top of the sql

this is a comment

I then proceeded as above with step 4 but ALL the sql in the administrator/sql/install.mysql.utf8.sql were processed

Did I do something wrong?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9137.

@brianteeman
Copy link
Contributor

oops markdown modified what I wrote
# this is a comment


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9137.

@laoneo
Copy link
Member

laoneo commented Feb 17, 2016

I have tested this item ✅ successfully on 1ef6317

I tested it successfully with DPCalendar.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9137.

@jsanchezgr
Copy link
Author

Brian, have you tried to install a fresh component or have you tried to update it? To replicate the issue you must install a component that is not already installed.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9137.

@laoneo
Copy link
Member

laoneo commented Feb 17, 2016

I can provide a modified DPCalendar version if needed to test.

@brianteeman
Copy link
Contributor

it was a clean web site installed just for this test using the current
staging

On 17 February 2016 at 12:36, Allon Moritz [email protected] wrote:

I can provide a modified DPCalendar version if needed to test.


Reply to this email directly or view it on GitHub
#9137 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

@brianteeman
Copy link
Contributor

Tested again using DPCalendar where I added
# this is a comment
to the very first line of /com_dpcalendar/admin/sql/install.mysql.utf8.sql

Again had no problem at all


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9137.

@brianteeman
Copy link
Contributor

I have tested this item 🔴 unsuccessfully on 1ef6317


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9137.

@jsanchezgr
Copy link
Author

Brian, if you test the issue with DPCalendar by adding a comment to the very first line of com_dpcalendar/admin/sql/install.mysql.utf8.sql the installer works ok, but the component not. Just after installing, go to Components->DP Calendar->Events and you'll get the following SQL error:

#__dpcalendar_events' doesn't exist SQL=SELECT u.id AS value, u.name AS text FROM #__users AS u INNER JOIN #__dpcalendar_events AS c ON c.created_by = u.id GROUP BY u.id, u.name ORDER BY u.name

This is because the events table is missing in your database.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9137.

@brianteeman
Copy link
Contributor

Ah I tested the other views in dpcalendar and they were ok. They were all
OK in my own component.
On 17 Feb 2016 1:40 pm, "Juan" [email protected] wrote:

Brian, if you test the issue with DPCalendar by adding a comment to the
very first line of com_dpcalendar/admin/sql/install.mysql.utf8.sql the
installer works ok, but the component not. Just after installing, go to
Components->DP Calendar->Events and you'll get the following SQL error:

#__dpcalendar_events' doesn't exist SQL=SELECT u.id AS value, u.name AS
text FROM #__users AS u INNER JOIN #__dpcalendar_events AS c ON
c.created_by = u.id GROUP BY u.id, u.name ORDER BY u.name

This is because the events table is missing in your database.

This comment was created with the J!Tracker Application
https://github.com/joomla/jissues at issues.joomla.org/joomla-cms/9137
https://issues.joomla.org/tracker/joomla-cms/9137.


Reply to this email directly or view it on GitHub
#9137 (comment).

@brianteeman
Copy link
Contributor

I have tested this item ✅ successfully on 1ef6317

Got it now - sorry for confusion
I thought you meant that evetything after the comment would be ignored when you meant the first thing after the comment


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9137.

@brianteeman
Copy link
Contributor

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9137.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Feb 17, 2016
wilsonge added a commit that referenced this pull request Feb 17, 2016
…-mysql-statement-after-a-comment

Avoid ignore SQL statement after comments starting by #
@wilsonge wilsonge merged commit fd683a9 into joomla:staging Feb 17, 2016
@wilsonge wilsonge added this to the Joomla! 3.5.0 milestone Feb 17, 2016
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Feb 17, 2016
@wilsonge
Copy link
Contributor

Merged

@jsanchezgr jsanchezgr deleted the Issue#9008-installer-ignores-mysql-statement-after-a-comment branch February 17, 2016 15:18
@jsanchezgr jsanchezgr restored the Issue#9008-installer-ignores-mysql-statement-after-a-comment branch February 17, 2016 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants