Menu

#2751 (ok 2.11.9) Undefined variable $seen_from

2.11.8
fixed
1
2013-06-11
2008-08-25
No

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 )

Discussion

  • Marc Delisle

    Marc Delisle - 2008-08-26
    • status: open --> pending
     
  • Gordon P. Hemsley

    • milestone: 784091 --> 2.11.8
    • status: pending --> open
     
  • Gordon P. Hemsley

    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.

     
  • Gordon P. Hemsley

    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'

     
  • Marc Delisle

    Marc Delisle - 2008-08-28
    • status: open --> pending
     
  • Marc Delisle

    Marc Delisle - 2008-08-28

    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?

     
  • Gordon P. Hemsley

    • status: pending --> open
     
  • Gordon P. Hemsley

    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).

     
  • Jürgen Wind

    Jürgen Wind - 2008-08-28

    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 ...

     
  • Jürgen Wind

    Jürgen Wind - 2008-08-28

    Logged In: YES
    user_id=1383652
    Originator: NO

    easy fix:
    replace all
    !$seen_from
    with
    !empty($seen_from)

     
  • Jürgen Wind

    Jürgen Wind - 2008-08-28

    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)

     
  • Marc Delisle

    Marc Delisle - 2008-08-28
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2008-08-28
    • summary: Undefined variable $seen_from in libraries/sqlparser.lib.php --> (ok 2.11.9) Undefined variable $seen_from
    • priority: 5 --> 1
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2008-08-28

    Logged In: YES
    user_id=210714
    Originator: NO

    Added initialization for $seen_from.

     
  • Marc Delisle

    Marc Delisle - 2008-08-28

    Logged In: YES
    user_id=210714
    Originator: NO

    Added initialization for $seen_from.

     
  • Marc Delisle

    Marc Delisle - 2008-08-28
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed
     
MongoDB Logo MongoDB