Notice: Undefined variable: seen_from in [...]/phpMyAdmin/libraries/sqlparser.lib.php on line 1148
Notice: Undefined variable: seen_from in [...]/phpMyAdmin/libraries/sqlparser.lib.php on line 1264
These errors seem to occur (and they are repeated over and over) when there is a SELECT query, but it is preceded by an open parenthesis. I'm getting these in 2.11.3, but it doesn't seem like it has been fixed trunk yet.
For example, this (anonymized) query causes the errors:
(
SELECT a.*, b.*
FROM table1 a
LEFT OUTER JOIN table2 b
ON ( a.id = b.id )
WHERE a.other_id = 'text'
#AND ( b.id IS NULL
#OR a.id IS NULL )
)
UNION ALL
(
SELECT a.*, b.*
FROM table1 a
RIGHT JOIN table2 b
ON ( a.id = b.id )
WHERE a.other_id = 'text'
#AND ( b.id IS NULL
#OR a.id IS NULL )
)
WHERE a.other_id = 'text'
AND ( b.id IS NULL
OR a.id IS NULL )
Logged In: YES
user_id=1383652
Originator: NO
2.11.3 <-- pretty outdated
try on the demo server:
Current stable version: pma 2.11.8.1
http://pma.cihar.com/STABLE/?pma_username=root
or pma 3.0 beta:
http://pma.cihar.com/TESTING/?pma_username=root
Logged In: YES
user_id=779036
Originator: YES
Well, I already mentioned that I didn't think it had been fixed in trunk yet, but I upgraded my install to 2.11.8.1 test it out, anyway. (Incidentally, there's no Group in this track for 2.11.8.1, so I'm changing it to 2.11.8.)
But, as I suspected, the notices are still there. However, the line numbers have changed:
Notice: Undefined variable: seen_from in [...]/phpMyAdmin/libraries/sqlparser.lib.php on line 1160
Notice: Undefined variable: seen_from in [...]/phpMyAdmin/libraries/sqlparser.lib.php on line 1276
And, also, as it may not be clear, that query does have a syntax error, so these notices appear on the error page—a whole slew of them prior to the server navigation breadcrumbs.
Logged In: YES
user_id=779036
Originator: YES
While the above query actually gives the errors when pasted verbatim (regardless of whether you actually have any tables that fit it), here is a much simpler query that gives the same results (albeit with few iterations of the notices):
(
SELECT * FROM `TABLES`
)
UNION ALL
(
SELECT * FROM `TABLES`
)
WHERE `ENGINE` = 'MyISAM'
Logged In: YES
user_id=210714
Originator: NO
On my server or the demo server http://pma.cihar.com/STABLE/, I cannot reproduce the problem with your long query or your short query. I choose a database, click on SQL and paste your example.
Can you reproduce it on the demo server?
Logged In: YES
user_id=779036
Originator: YES
No, I can't. But that's likely because the demo server has E_NOTICE errors turned off. The demo server's error_reporting is set to E_ALL ^ E_NOTICE (integer value 6135), while my server has error_reporting set to everything below E_DEPRECATED (integer value 8191).
Logged In: YES
user_id=1383652
Originator: NO
confirmed with error_reporting E_ALL (6143 atm):
Notice: Undefined variable: seen_from in D:\PMA\Stable\libraries\sqlparser.lib.php on line 1160
and on more lines ...
Logged In: YES
user_id=1383652
Originator: NO
easy fix:
replace all
!$seen_from
with
!empty($seen_from)
Logged In: YES
user_id=1383652
Originator: NO
sorry, reprase:
in all if clauses
replace all !$seen_from with empty($seen_from)
replace all $seen_from with !empty($seen_from)
Logged In: YES
user_id=210714
Originator: NO
Added initialization for $seen_from.
Logged In: YES
user_id=210714
Originator: NO
Added initialization for $seen_from.