Project

General

Profile

Actions

Bug #2512

closed

mysql_vhosts Complex SQL

Added by tronox@hotmail.com over 11 years ago. Updated over 11 years ago.

Status:
Duplicate
Priority:
Normal
Category:
mod_mysql_vhost
Target version:
-
ASK QUESTIONS IN Forums:

Description

Upon reading the documentation I came up with the below SQL:

SELECT * FROM (SELECT IF((SELECT rootdir FROM vhosts WHERE vhost='?'),(SELECT rootdir FROM vhosts WHERE vhost='?'),(SELECT rootdir FROM vhosts WHERE '?' like vhost)) as rootdir) as a WHERE rootdir IS NOT NULL

This will return a row with an exact match to the host or if not found a row matching '%.example.com'. If neither are found it returns nothing. However it breaks the vhost.
Example(s):
http://test.bfddesigns.net/
Which should return a path of: /var/www/vhosts/bfddesigns.net/subdomains/test/index.php but does not.
When I revert the SQL to the default SQL everything works fine.


Related issues 1 (0 open1 closed)

Is duplicate of Feature #2163: Multiple use of '?' in mysql-vhost.sqlFixed2010-02-07Actions
Actions #1

Updated by stbuehler over 11 years ago

  • Status changed from New to Duplicate
  • Target version deleted (1.4.x)
Actions

Also available in: Atom