SQL 2008 R2 on IIS7 SQL - Select Error after install

This forum is for issues with installing Joomla! 3.x on IIS webservers.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
ChrisN
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Jun 03, 2014 8:55 am
Location: Brisbane Australia
Contact:

SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by ChrisN » Tue Jun 03, 2014 9:01 am

Hi, I am new to Joomla, and just trying to install it for the first time to see if it works for me..

I am using Server2008 R2 with IIS7 as web server.
Connecting to an SQL2008 R2 database running on a SQL server 2008 R2 Machine.
The whole install works fine (select SQLSrv from database list in step 4.)
Connects creates tables and no errors.
Completes install but have to manually remove Installation folder (Button in step 7 just says "Error" underneath the button when pressed, so remove this folder manually).
When I open the browser to open the newly created web site i get this huge SQL Select error in red.

[Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near the keyword 'LEFT'.SQL=SELECT * FROM ( SELECT a.id, a.title, a.alias, a.title_alias, a.introtext, a.language, a.checked_out, a.checked_out_time, a.catid, a.created, a.created_by, a.created_by_alias, CASE WHEN a.modified = 0 THEN a.created ELSE a.modified END as modified, a.modified_by, uam.name as modified_by_name,CASE WHEN a.publish_up = 0 THEN a.created ELSE a.publish_up END as publish_up,a.publish_down, a.images, a.urls, a.attribs, a.metadata, a.metakey, a.metadesc, a.access, a.hits, a.xreference, a.featured, LEN(a.fulltext) AS readmore,CASE WHEN badcats.id is not null THEN 0 ELSE a.state END AS state,c.title AS category_title, c.path AS category_route, c.access AS category_access, c.alias AS category_alias,CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author,ua.email AS author_email,( SELECT MAX(contact.id) AS id , ROW_NUMBER() OVER (ORDER BY c.lft, a.featured DESC, fp.ordering, a.created DESC ) AS RowNumber FROM qg09d_contact_details AS contact WHERE contact.published = 1 AND contact.user_id = a.created_by) as contactid,parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias,ROUND(v.rating_sum / v.rating_count, 0) AS rating, v.rating_count as rating_count,c.published, CASE WHEN badcats.id is null THEN c.published ELSE 0 END AS parents_published FROM qg09d_content AS a ) _myResults WHERE RowNumber BETWEEN 1 AND 4 LEFT JOIN qg09d_categories AS c ON c.id = a.catid LEFT JOIN qg09d_users AS ua ON ua.id = a.created_by LEFT JOIN qg09d_users AS uam ON uam.id = a.modified_by LEFT JOIN qg09d_categories as parent ON parent.id = c.parent_id LEFT JOIN qg09d_content_rating AS v ON a.id = v.content_id LEFT OUTER JOIN (SELECT cat.id as id FROM qg09d_categories AS cat JOIN qg09d_categories AS parent ON cat.lft BETWEEN parent.lft AND parent.rgt WHERE parent.extension = N'com_content' AND parent.published != 1 GROUP BY cat.id ) AS badcats ON badcats.id = c.id INNER JOIN qg09d_content_frontpage AS fp ON fp.content_id = a.id WHERE a.access IN (1,1) AND c.access IN (1,1) AND CASE WHEN badcats.id is null THEN a.state ELSE 0 END = 1 AND (a.publish_up = N'1900-01-01 00:00:00' OR a.publish_up <= N'2014-06-03 08:30:28') AND (a.publish_down = N'1900-01-01 00:00:00' OR a.publish_down >= N'2014-06-03 08:30:28') [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near the keyword 'WHERE'.SQL=SELECT a.id, a.title, a.alias, a.title_alias, a.introtext, a.language, a.checked_out, a.checked_out_time, a.catid, a.created, a.created_by, a.created_by_alias, CASE WHEN a.modified = 0 THEN a.created ELSE a.modified END as modified, a.modified_by, uam.name as modified_by_name,CASE WHEN a.publish_up = 0 THEN a.created ELSE a.publish_up END as publish_up,a.publish_down, a.images, a.urls, a.attribs, a.metadata, a.metakey, a.metadesc, a.access, a.hits, a.xreference, a.featured, LEN(a.fulltext) AS readmore,CASE WHEN badcats.id is not null THEN 0 ELSE a.state END AS state,c.title AS category_title, c.path AS category_route, c.access AS category_access, c.alias AS category_alias,CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author,ua.email AS author_email,(SELECT * FROM ( SELECT MAX(contact.id) AS id , ROW_NUMBER() OVER (ORDER BY (select 0)) AS RowNumber FROM qg09d_contact_details AS contact) _myResults WHERE RowNumber BETWEEN 1 AND 4 WHERE contact.published = 1 AND contact.user_id = a.created_by) as contactid,parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias,ROUND(v.rating_sum / v.rating_count, 0) AS rating, v.rating_count as rating_count,c.published, CASE WHEN badcats.id is null THEN c.published ELSE 0 END AS parents_published FROM qg09d_content AS a LEFT JOIN qg09d_categories AS c ON c.id = a.catid LEFT JOIN qg09d_users AS ua ON ua.id = a.created_by LEFT JOIN qg09d_users AS uam ON uam.id = a.modified_by LEFT JOIN qg09d_categories as parent ON parent.id = c.parent_id LEFT JOIN qg09d_content_rating AS v ON a.id = v.content_id LEFT OUTER JOIN (SELECT cat.id as id FROM qg09d_categories AS cat JOIN qg09d_categories AS parent ON cat.lft BETWEEN parent.lft AND parent.rgt WHERE parent.extension = N'com_content' AND parent.published != 1 GROUP BY cat.id ) AS badcats ON badcats.id = c.id INNER JOIN qg09d_content_frontpage AS fp ON fp.content_id = a.id WHERE a.access IN (1,1) AND c.access IN (1,1) AND CASE WHEN badcats.id is null THEN a.state ELSE 0 END = 1 AND (a.publish_up = N'1900-01-01 00:00:00' OR a.publish_up <= N'2014-06-03 08:30:28') AND (a.publish_down = N'1900-01-01 00:00:00' OR a.publish_down >= N'2014-06-03 08:30:28')

-------------------------------------------------------------------------------
Here is the code from the assstant (I think I did it right, is all very confusing and does not have a very good user interface).
Forgive me if I did it wrong I am just learning this product
Forum Post Assistant (v1.2.4) : 3rd June 2014 wrote:
Basic Environment :: wrote:Joomla! Instance :: Joomla! 2.5.20-Stable (Ember) 30-April-2014
Joomla! Platform :: Joomla Platform 11.4.0-Stable (Brian Kernighan) 03-Jan-2012
Joomla! Configured :: Yes | Writable (666) | Owner: 0 (uid: /gid: ) | Group: 0 (gid: ) | Valid For: 2.5
Configuration Options :: Offline: 0 | SEF: 1 | SEF Suffix: 0 | SEF ReWrite: 0 | .htaccess/web.config: No | GZip: 0 | Cache: 0 | FTP Layer: 0 | SSL: N/A | Error Reporting: default | Site Debug: 0 | Language Debug: 0 | Default Access: 1 | Unicode Slugs: 0 | Database Credentials Present: Yes

Host Configuration :: OS: Windows NT | OS Version: 6.1 | Technology: i586 | Web Server: Microsoft-IIS/7.5 | Encoding: gzip,deflate,sdch | Doc Root: D:/MTDLuggage | System TMP Writable: No

PHP Configuration :: Version: 5.4.14 | PHP API: cgi-fcgi | Session Path Writable: No | Display Errors: | Error Reporting: 22527 | Log Errors To: C:\Windows\temp\php54_errors.log | Last Known Error: | Register Globals: | Magic Quotes: | Safe Mode: | Open Base: | Uploads: 1 | Max. Upload Size: 2M | Max. POST Size: 8M | Max. Input Time: 60 | Max. Execution Time: 300 | Memory Limit: 128M

MySQL Configuration :: Connection Error: : Database Credentials Present? in Configuration...
Detailed Environment :: wrote:PHP Extensions :: Core (5.4.14) | bcmath () | calendar () | ctype () | date (5.4.14) | ereg () | filter (0.11.0) | ftp () | hash (1.0) | iconv () | json (1.2.1) | mcrypt () | SPL (0.2) | odbc (1.0) | pcre () | Reflection ($Id: 6c4d8062369898a397e4b128348042f5c01b4427 $) | session () | standard (5.4.14) | mysqlnd (mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $) | tokenizer (0.1) | zip (1.11.0) | zlib (2.0) | libxml () | dom (20031129) | PDO (1.0.4dev) | openssl () | SimpleXML (0.1) | wddx () | xml () | xmlreader (0.1) | xmlwriter (0.1) | cgi-fcgi () | mysql (1.0) | mysqli (0.1) | mbstring () | gd () | gettext () | curl () | exif (1.4 $Id$) | xmlrpc (0.51) | Phar (2.0.1) | soap () | pdo_mysql (1.0.2) | pdo_sqlite (1.0.1) | imap () | tidy (2.0) | pdo_sqlsrv (3.0.3421.0) | sqlsrv (3.0.3421.0) | mhash () | Zend Engine (2.4.0) |
Potential Missing Extensions :: suhosin |

Switch User Environment (Experimental) :: PHP CGI: Yes | Server SU: No | PHP SU: Yes | Custom SU (LiteSpeed/Cloud/Grid): Yes
Potential Ownership Issues: No
Folder Permissions :: wrote:Core Folders :: images/ (777) | components/ (777) | modules/ (777) | plugins/ (777) | language/ (777) | templates/ (777) | cache/ (777) | logs/ (777) | tmp/ (777) | administrator/components/ (777) | administrator/modules/ (777) | administrator/language/ (777) | administrator/templates/ (777) |

Elevated Permissions (First 10) :: administrator/ (777) | administrator/cache/ (777) | administrator/components/ (777) | administrator/components/com_admin/ (777) | administrator/components/com_admin/controllers/ (777) | administrator/components/com_admin/helpers/ (777) | administrator/components/com_admin/helpers/html/ (777) | administrator/components/com_admin/models/ (777) | administrator/components/com_admin/models/forms/ (777) | administrator/components/com_admin/sql/ (777) |
Extensions Discovered :: wrote:Components :: SITE :: com_mailto (2.5.0) | com_wrapper (2.5.0) |
Components :: ADMIN :: com_admin (2.5.0) | com_banners (2.5.0) | com_cache (2.5.0) | com_categories (2.5.0) | com_checkin (2.5.0) | com_config (2.5.0) | com_content (2.5.0) | com_cpanel (2.5.0) | com_finder (2.5.0) | com_installer (2.5.0) | com_joomlaupdate (2.5.0) | com_languages (2.5.0) | com_login (2.5.0) | com_media (2.5.0) | com_menus (2.5.0) | com_messages (2.5.0) | com_modules (2.5.0) | com_newsfeeds (2.5.0) | com_plugins (2.5.0) | com_redirect (2.5.0) | com_search (2.5.0) | com_templates (2.5.0) | com_users (2.5.0) | com_weblinks (2.5.0) |

Modules :: SITE :: mod_articles_archive (2.5.0) | mod_articles_categories (2.5.0) | mod_articles_category (2.5.0) | mod_articles_latest (2.5.0) | mod_articles_news (2.5.0) | mod_articles_popular (2.5.0) | mod_banners (2.5.0) | mod_breadcrumbs (2.5.0) | mod_custom (2.5.0) | mod_feed (2.5.0) | mod_finder (2.5.0) | mod_footer (2.5.0) | mod_languages (2.5.0) | mod_login (2.5.0) | mod_menu (2.5.0) | mod_random_image (2.5.0) | mod_related_items (2.5.0) | mod_search (2.5.0) | mod_stats (2.5.0) | mod_syndicate (2.5.0) | mod_users_latest (2.5.0) | mod_weblinks (2.5.0) | mod_whosonline (2.5.0) | mod_wrapper (2.5.0) |
Modules :: ADMIN :: mod_custom (2.5.0) | mod_feed (2.5.0) | mod_latest (2.5.0) | mod_logged (2.5.0) | mod_login (2.5.0) | mod_menu (2.5.0) | mod_multilangstatus (2.5.0) | mod_popular (2.5.0) | mod_quickicon (2.5.0) | mod_status (2.5.0) | mod_submenu (2.5.0) | mod_title (2.5.0) | mod_toolbar (2.5.0) | mod_version (2.5.0) |

Plugins :: SITE :: plg_authentication_gmail (2.5.0) | plg_authentication_joomla (2.5.0) | plg_authentication_ldap (2.5.0) | plg_captcha_recaptcha (2.5.0) | plg_content_emailcloak (2.5.0) | plg_content_finder (2.5.0) | plg_content_geshi (2.5.0) | plg_content_joomla (2.5.0) | plg_content_loadmodule (2.5.0) | plg_content_pagebreak (2.5.0) | plg_content_pagenavigation (2.5.0) | plg_content_vote (2.5.0) | plg_editors_codemirror (1.0) | plg_editors_tinymce (3.5.4.1) | plg_editors-xtd_article (2.5.0) | plg_editors-xtd_image (2.5.0) | plg_editors-xtd_pagebreak (2.5.0) | plg_editors-xtd_readmore (2.5.0) | plg_extension_joomla (2.5.0) | plg_finder_categories (2.5.0) | plg_finder_contacts (2.5.0) | plg_finder_content (2.5.0) | plg_finder_newsfeeds (2.5.0) | plg_finder_weblinks (2.5.0) | plg_quickicon_extensionupdate (2.5.0) | plg_quickicon_joomlaupdate (2.5.0) | plg_search_categories (2.5.0) | plg_search_contacts (2.5.0) | plg_search_content (2.5.0) | plg_search_newsfeeds (2.5.0) | plg_search_weblinks (2.5.0) | plg_system_cache (2.5.0) | plg_system_debug (2.5.0) | plg_system_highlight (2.5.0) | plg_system_languagecode (2.5.0) | plg_system_languagefilter (2.5.0) | plg_system_log (2.5.0) | plg_system_logout (2.5.0) | plg_system_p3p (2.5.0) | plg_system_redirect (2.5.0) | plg_system_remember (2.5.0) | plg_system_sef (2.5.0) | plg_user_contactcreator (2.5.0) | plg_user_joomla (2.5.0) | plg_user_profile (2.5.0) |
Templates Discovered :: wrote:Templates :: SITE :: atomic (2.5.0) | beez5 (2.5.0) | beez_20 (2.5.0) |
Templates :: ADMIN :: bluestork (2.5.0) | hathor (2.5.0) |

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by sovainfo » Tue Jun 03, 2014 12:43 pm

Suggest https://github.com/joomla/joomla-cms/pull/3602
Also have a look at all other PR releated to MSSQL.
Would appreciate it if you left comments at the appropriate JC issues.
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

ChrisN
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Jun 03, 2014 8:55 am
Location: Brisbane Australia
Contact:

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by ChrisN » Tue Jun 03, 2014 1:20 pm

Wow, thanks for your quick answer, up late working a? ha ha.

I have had a look at the link you gave me but don't understand any of it.
I thought I could just do a straight install and everything would work. No idea I would have this much trouble have been working on this for more than 12 hours straight now. Looked everywhere and tried so many things, it cant be this hard to fix can it?

I have no idea what to do with the information in that link, wondering if you can point me to somewhere that tells you the answer in plain english, that would very much appreciated.
Also yes have searched all the forums for anything to do with SQL and MSSQL most of them don't make any sense to me or the ones I could understand I tried but still get the same error.
I am wondering if this software is either a bit too young and not had the bugs worked out of it yet, or it is designed for simple or basic systems, would I be right in saying that or am I totally off base?
I am surprised using a standard SQL database and Windows server would be a pretty standard setup, so not sure why this bug has come up.

Thanks again for your time in answering my question, will keep my fingers crossed you can give me somewhere to go (and be nice ha ha).
Also what does PR and JC mean, I am showing my ignorance now aren't I?

Cheers Virtuoso and thanks for trying
Chris

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by sovainfo » Tue Jun 03, 2014 2:04 pm

Four o'clock in the afternoon here!

If you add /files to the URL I gave above you'll see the changes in the files you need to make. You could also use com_patchtester and apply PR's by number.

Unfortunately, the community doesn't have that many users active on MSSQL or PostgreSQL for that matter. That leaves a lot unresolved because the process of fixing stuff is based on users testing and reporting their findings. Introducing the BUGS is easy, they just need to remain undetected, which is not a problem with the low level of participation. Fixing them is very hard! Meaning to get them fixed in the next release. Providing the fixes is not the problem, even made easier with Github. To get them in the product turns out to be impossible.

PR: Pull request. Proposal for code changes by an outsider to be accepted (merged) by the owner

JC: Joomlacode.org with trackers for issues and feature request and download of the distribution packages. Currently still used in combination with issues/pr's on Github to administer changes to the code base.

Edit libraries/joomla/database/query.php
replace line 476 with

Code: Select all

if ($this instanceof JDatabaseQueryLimitable && ($this->limit > 0 || $this->offset > 0))
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

ChrisN
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Jun 03, 2014 8:55 am
Location: Brisbane Australia
Contact:

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by ChrisN » Wed Jun 04, 2014 2:04 am

Hi there,
Sorry about the time, it is just that your post showed the time of 10:43pm, something must be crook ha ha...
Thanks for the extra information, let me tell you where I am at now.
I checked out Com_patchtester and downloaded and I think I installed OK, as the instructions don't tell you where to put it. But that aside I am under the impression this only works after you have logged in, or get Joomla to work.
I can't even get that far. My error comes up as soon as I remove the install folder then try to open Joomla where it shows the login screen.

I then wanted to carry out your instructions to replace line 476 in query.php.
I have never seen or used PHP but when I look at that particular line of code is seems it is in a sort of select block (I use .net)
I even downloaded Rapid PHP v12.2 to make sure the line number were being read correctly.

Here is what line 476 looks like in my query.php

474 public function clear($clause = null)
475 {
476 switch ($clause)
477 {
478 case 'select':
479 $this->select = null;
480 $this->type = null;
481 break;

So do I really replace line 476 with your code? Or do I have the wrong version of Joomla, or the wrong program. I wish I could figure out what I am doing wrong, i seems everything I do with Joomla seems to have a problem. It looks like it creates great web sites but I just can't get started?

I am sorry I am causing you time and effort, if not many people use SQL and Server I am a pain because my solution won't help many people.
I think that if I can't get something working today I will have to tell my client I can't manage their web site or make any changes to it and he will have to go somewhere else. I have invested more than 18 hours in just trying to get Joomla working, then I have to learn how to use it. I am so frustrated.

I really do appreciate your time and effort but understand if you can't point me in the right direction.

Best Regards
Chris

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by sovainfo » Wed Jun 04, 2014 7:57 am

Sorry, my fault. Didn't see you were using J2.5.20. I am focussed on J3, recognized the strange structure and immediately connected it to my PR. Just had a look and my solution doesn't directly apply to J2.5. Purely out of interest I will continue research but don't think that will be in time for this customer.
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

ChrisN
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Jun 03, 2014 8:55 am
Location: Brisbane Australia
Contact:

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by ChrisN » Wed Jun 04, 2014 11:53 am

I am the one that should apologise, i really thought I was using J3, but i remember i downloaded the older version to see if that worked and forgot to put the new one back.
I have done that now and I see where you suggest code went but sorry to say it did not work or seem to make any difference.

What I have done is a quick screen capture of me going through the install and to show you what I am doing in case i am doing some stupid rookie thing.
The one thing I notice is that when the error comes up there is a line of code that shows a username and password.
Not sure if this is left over from development, or if it is having an affect on the install but I highlight the line at the end of the install in the video.
I am not sure what should be shown where the error comes up maybe that will give you a clue when you see it as to what the query is trying to do at that point.

I should mention that the URL that i use to install Joomla is an old domain name i don't use at present and i just got this to point to the joomla web site i setup on my server.

Thanks for keeping on trying, i am frustrated enough now that I want to beat this, i hate to give up, but wish I understood PHP better.
Anyway the video is on [youtube], URL is http://youtu.be/mFYeMKjHXEg

Just had a thought that I might do a video of me setting everything up from the start SQL and copying the Joomla files etc, not sure if it is going to be any help but there could be something stupid I am doing that is causing the error.
Another interesting bit of information is that after I complete the install and then remove the installation folder and try and run it i get this error in the browser.
"No configuration file found and no installation code available. Exiting..."


Ok Cheers Sovainfo, and by the way where are you?
I am in Brisbane Australia..

Thanks mate.

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by sovainfo » Wed Jun 04, 2014 12:50 pm

Hi, I am from the Netherlands in Europe. Understand your frustration, upset with myself because I missed that on J2.5. Must be getting old, or just trying to do too many things at the same time.

About to go look at the video. Don't think the other one is needed. You can't do much wrong there. You should be able to have IIS create the configuration.php upon installation. Have a look at the settings for the DocumentRoot (meaning the folder you placed all joomla files in).
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

ChrisN
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Jun 03, 2014 8:55 am
Location: Brisbane Australia
Contact:

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by ChrisN » Wed Jun 04, 2014 12:59 pm

Old, ha ha wait till you get my age, The Netherlands, is it cold there now?

I think that is where the problem lays, it does not create the configuration file.
I unticked the bit to install sample data and run the install again and as soon as it gets to the create the configuration bit it throws the error.
Also cant find any configuration file in the DocumentRoot folder, can you tell me what the configuration file is called and whats in it?

If you sent me one (a configuration file) that works is it possible to make changes inside the file so it suites my setup or is it a bit to complex or encrypted or in binary?

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by sovainfo » Wed Jun 04, 2014 1:24 pm

Have a look at https://github.com/joomla/joomla-cms/pull/3576/files
Apply those changes as mentioned in joomla.sql to get through the installation properly.
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

ChrisN
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Jun 03, 2014 8:55 am
Location: Brisbane Australia
Contact:

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by ChrisN » Wed Jun 04, 2014 2:25 pm

Dont want to keep you hanging, but I have made those changes, I have my fingers crossed, now.
The problem I have now is that I changed some PHP resources in IIS7 did a reboot when you said about the PHP in IIS7 and wanted to see if that was all OK. But now I don't have the SQL Server option in the database drop down selection of Joomla.

So I am restoring the C drive on my web server to yesterday when that was working.
I dont know what i did to lose that option in the list but obviously something to do with the PHP manager in IIS7.

So I am not ignoring you just trying to fix up something I stuffed up.
Will let you know if I get lucky as soon as I get my system is back to the right state.

Thanks for hanging in there, they should have 6 starts for guys like you, I see you handle a lot of questions and issues. Are you the main developer of the program?

Chris

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by sovainfo » Wed Jun 04, 2014 2:47 pm

No, just a volunteer. We use Joomla for our intranet. This is my way of contributing.
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

ChrisN
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Jun 03, 2014 8:55 am
Location: Brisbane Australia
Contact:

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by ChrisN » Wed Jun 04, 2014 3:01 pm

Man your company is lucky to have you looking after their intranet, it is rare to see some one stick at something this long.. Not to mention Joomla, they should be thanking you heaps for helping guys like me with these problems, sure would have given up by now if it wasn't for you kind help and expert knowledge.

Anyway IT WORKED (well sort of).
It went through the whole install with no errors, yep not a single error. It even let me remove the install folder with no errors and it looked very promising.

Then I fired it up with out the install folder and would you believe I get this error.

Error displaying the error page: Application Instantiation Error: [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near ','.SQL=SELECT * FROM ( DELETE , ROW_NUMBER() OVER (ORDER BY (select 0)) AS RowNumber FROM [txywb_session] WHERE [time] < '1401892547') _myResults WHERE RowNumber BETWEEN 1 AND 0

I am hoping it is another fix like the last, as that would be so cool, I feel like we are so close now, I can't tell what a great job you have done, i did feel frustrated and let down about it before but now I have hope.

Any ideas?
Chris

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30936
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by Per Yngve Berg » Wed Jun 04, 2014 3:18 pm

Mod. Note: Relocated the topic to the Installation on IIS web server forum.

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by sovainfo » Wed Jun 04, 2014 3:54 pm

Thank you for those nice compliments. Don't give yet. We are close, back to the issue we started with.

Indeed the installation should be without any issue. Apart from those silly syntax mistakes. Just fix the one-liner to add those conditions. As you can see it end with 1 and 0.
That is what the additional conditions will solve. Applying a limit on a DELETE makes no sense. My other PR fixes this for the MSSQL driver, this one is the generic query. Which means MySQL and PostgreSQL have that problem as well. Only the don't notice because they haven't got such a complicated structure added to the query.

So just apply that one-liner and you should be good to go for the next issue! 8)
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

ChrisN
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Jun 03, 2014 8:55 am
Location: Brisbane Australia
Contact:

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by ChrisN » Thu Jun 05, 2014 4:15 am

Unreal, too often people like yourself offer your expertise and time and no one thanks you for it, so you're more than welcome to the compliments, you sure have earned them.

Ok added the one liner, which I guess is
(if ($this instanceof JDatabaseQueryLimitable && ($this->limit > 0 || $this->offset > 0))).

Unfortunately it did not make any difference. I still get this error after deleting the installation folder and trying to run Joomla.
Error displaying the error page: Application Instantiation Error: [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near the keyword 'WHERE'.SQL=SELECT * FROM ( SELECT [session_id] , ROW_NUMBER() OVER (ORDER BY (select 0)) AS RowNumber FROM [x0ksv_session]) _myResults WHERE RowNumber BETWEEN 1 AND 1 WHERE [session_id] = 'lelsgk2kmu7v8nmh2ncb8v2ps5'

Just having a little trouble understanding if have to change anything else.
I looked in the installation/sql/sqlazure/ folder and the administrator/components/com_admin/sql/updates/sqlazure folder to see if I could see that pattern anywhere else but was unable to.

Can you give me a little bit more guidance...

Cheers mate, hope you day at work is going great..
Chris

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by sovainfo » Thu Jun 05, 2014 7:38 am

Actually it did make a difference. Notice that it now says BETWEEN 1 and 1. Those are real numbers. So see https://github.com/sovainfo/joomla-cms/ ... 97010dc008
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

jbeauchamp
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Nov 20, 2013 7:53 pm

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by jbeauchamp » Tue Sep 30, 2014 10:05 pm

I've confirmed that the fix works for 3.3.4.

Line 477 of libraries/joomla/database/query.php:

Code: Select all

if ($this instanceof JDatabaseQueryLimitable && ($this->limit > 0 || $this->offset > 0))
So now can we get it added to all future versions?

Thanks for figuring this out!

James

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: SQL 2008 R2 on IIS7 SQL - Select Error after install

Post by sovainfo » Tue Sep 30, 2014 10:41 pm

That would require a post on https://github.com/joomla/joomla-cms/pull/3602 stating that you tested it and resolved the issue.
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!


Locked

Return to “Joomla! 3.x on IIS webserver”