? ? ? Pending

User tests: Successful: Unsuccessful:

avatar csthomas
csthomas
16 Feb 2017

Summary of Changes

Update sql files for mssql database has invalid syntax.
This PR fix files from 3.5.0 and one older to correct syntax.

Testing Instructions

  • Install Joomla 3.5.0 on sqlsrv (mssql) database in folder joomla
  • Download and extract Joomla from https://github.com/csthomas/joomla-cms/archive/msfixupdate.zip to folder joomla37
  • Move joomla to joomla_old
  • Move joomla37 to joomla
  • Copy joomla_old/configuration.php to joomla/configuration.php
  • Download postupdate.php file from https://gist.github.com/mbabker/d7bfb4e1e2fbc6b7815a733607f89281#file-postupdate-php and save it in joomla/administrator/ folder.
  • [optional] Add a few changes as on below diff file to debugging if you like:
diff --git a/libraries/joomla/database/driver/sqlsrv.php b/libraries/joomla/database/driver/sqlsrv.php
index a0b4285cfb..d2a2097a3d 100644
--- a/libraries/joomla/database/driver/sqlsrv.php
+++ b/libraries/joomla/database/driver/sqlsrv.php
@@ -630,7 +630,7 @@ class JDatabaseDriverSqlsrv extends JDatabaseDriver
                {
                        $array = array();
                }
-
+echo "$query\n\n";
                // Execute the query. Error suppression is used here to prevent warnings/notices that the connection has been lost.
                $this->cursor = @sqlsrv_query($this->connection, $query, array(), $array);
 
@@ -685,7 +685,7 @@ class JDatabaseDriverSqlsrv extends JDatabaseDriver
                        {
                                // Get the error number and message from before we tried to reconnect.
                                $this->errorNum = $errorNum;
-                               $this->errorMsg = $errorMsg;
+                               $this->errorMsg = $errorMsg;echo "\n\n $errorMsg\n\n";
 
                                // Throw the normal query exception.
                                JLog::add(JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg), JLog::ERROR, 'database-error');
  • run php -f administrator/postupdate.php
  • From time to time if you apply diff file to see debug info you may see:
DELETE 
FROM [j37_session]
WHERE [time] < N'1487235471'

Error displaying the error page: Application Instantiation Error: Failed to start the session because headers have already been sent by ".../libraries/joomla/database/driver/sqlsrv.php" at line 633.

Then try again run php file, after a few times it won't failed:)

  • At the end of logs you should see:
Update to 3.7.0-beta3 completed successfully.

or if this PR is still not perfect then (TEST FAILED):

Failed to finalize the upgrade, please check the logs for additional details.

Alternative way to test for git users:

git clone ...
git checkout -f 3.5.0
rm configuration.php # if exists
# Install Joomla 3.5.0 on sqlsrv
git checkout -f staging
curl https://patch-diff.githubusercontent.com/raw/joomla/joomla-cms/pull/14102.diff | git apply
# Apply above diff file
php -f administrator/postupdate.php
...

I have tested only from Joomla 3.5.0 because I have not php 5.6 or less.

Expected result

Upgrade from Joomla 3.5.0 to 3.7 will go without errors.

Actual result

Upgrade fails.

Documentation Changes Required

None

avatar csthomas csthomas - open - 16 Feb 2017
avatar csthomas csthomas - change - 16 Feb 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Feb 2017
Category MS SQL SQL Administration com_admin Libraries
avatar csthomas csthomas - change - 16 Feb 2017
The description was changed
avatar csthomas csthomas - edited - 16 Feb 2017
avatar csthomas csthomas - change - 16 Feb 2017
The description was changed
avatar csthomas csthomas - edited - 16 Feb 2017
avatar csthomas csthomas - change - 16 Feb 2017
Title
MSSQL update files - fix query syntax
MSSQL fix sql syntax in administrator/components/com_admin/sql/updates/sqlazure
avatar csthomas csthomas - edited - 16 Feb 2017
avatar csthomas csthomas - change - 17 Feb 2017
Labels Added: ?
avatar alikon
alikon - comment - 18 Feb 2017

i've followed first test info
upgraded from 3.6.5 to Joomla! 3.7.0-beta3 dev [ Amani ] 8-February-2017 14:11 GMT
on Microsoft SQL Server 12.00.2000
successfully

but after visiting home page got a 404 Component not found.

avatar alikon alikon - test_item - 18 Feb 2017 - Not tested
avatar alikon alikon - test_item - 18 Feb 2017 - Tested successfully
avatar alikon
alikon - comment - 18 Feb 2017

I have tested this item successfully on 2ec04fa


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

cause previous mentioned isssues are present on current staging too

avatar csthomas
csthomas - comment - 18 Feb 2017

Backend error become from $query->group() which I fixed at #13262.

The 404 error is unrelated, but I do not see it on linux.
I get only error message from joomla generated by some plugin (default enabled).
I have to turn on windows on virtual machine:)

avatar csthomas
csthomas - comment - 18 Feb 2017

The 404 error also appears on staging joomla installation on mssql. So it is not related.

avatar waader
waader - comment - 18 Feb 2017

I tried it with Joomla 3.4.8 and php 5.3.29. postupdate.php gives some warnings on each invocation. After logging into backend I get
Error loading component: com_fields, Component not found.
and Manage > Database gives this list, that is not fixable:
Database schema version (None) does not match CMS version (3.7.0-2017-02-02).
Database update version (3.7.0-beta2) does not match CMS version (3.7.0-beta3).
Table N'epik2_fields' does not exist. (From file 3.7.0-2016-08-29.sql.)
Table N'epik2_fields_categories' does not exist. (From file 3.7.0-2016-08-29.sql.)
Table N'epik2_fields_groups' does not exist. (From file 3.7.0-2016-08-29.sql.)
Table N'epik2_fields_values' does not exist. (From file 3.7.0-2016-08-29.sql.)

avatar csthomas csthomas - change - 18 Feb 2017
Labels Added: ?
avatar csthomas
csthomas - comment - 18 Feb 2017

@waader I have fixed one another file from 3.5.0. your upgrade stop on this file, there is a reason of above problems.

avatar csthomas
csthomas - comment - 18 Feb 2017

I have merged branch 'staging' into 'msfixupdate' in order to add #14133 changes.

avatar csthomas
csthomas - comment - 19 Feb 2017

Now you can upgrade from joomla >= 3.4.0 but there is still a few bugs in updates files IIRC 3.03, 3.2.x and 3.4.0

avatar waader
waader - comment - 19 Feb 2017

Upgrade from Joomla 3.4.8 works now.

avatar csthomas
csthomas - comment - 23 Feb 2017

I have to rebase this patch, there is not changes. No should be easier to test by Patch Tester.

avatar waader waader - test_item - 24 Feb 2017 - Tested successfully
avatar waader
waader - comment - 24 Feb 2017

I have tested this item successfully on d441d0d

Could it be that mssql didn´t work for joomla3.0.2 at all. I tried to install this version but couldn´t reach the second tab (database). As upgrade from 3.4.8 works I mark this as successfull.


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

avatar csthomas
csthomas - comment - 25 Feb 2017

When I choose no sample then it works better but you should not use Database -> Fix button on that PR.
After you click on Fix button then probably not all queries will be perform.

I do it in different way on windows. In general it is described at the Test Instruction above.
But for wamp installation my last command looks like:

C:\wamp\www\joomla370>..\..\bin\php\php5.6.25\php.exe -c ..\..\bin\php\php5.6.25
\phpForApache.ini -f administrator\postupdate.php
Update to 3.7.0-beta3 completed successfully.
avatar csthomas
csthomas - comment - 2 Mar 2017

Can someone with privilege can merge this PR. This is for mssql only with last success test.
There are only sql updates files. Last php file is already merged.

It is blocking me from creating a next PR.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 3 Mar 2017

pinging @infograf768

avatar infograf768 infograf768 - change - 3 Mar 2017
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 3 Mar 2017

RTC, as it is unlikely that we will get more MSSQL testers.


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

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 3 Mar 2017

thanks @infograf768

avatar rdeutz rdeutz - change - 3 Mar 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-03-03 15:06:28
Closed_By rdeutz
Labels Added: ?
avatar rdeutz rdeutz - close - 3 Mar 2017
avatar rdeutz rdeutz - merge - 3 Mar 2017

Add a Comment

Login with GitHub to post a comment