phpmyadmin / phpmyadmin

A web interface for MySQL and MariaDB
https://www.phpmyadmin.net/
GNU General Public License v2.0
7.27k stars 3.41k forks source link

Can not open table with JSON field (ver phpmyadmin all 4:4.5.4.1-2ubuntu2 ) #13497

Closed towndwarf closed 7 years ago

towndwarf commented 7 years ago

Steps to reproduce

  1. create data table with INT field and JSON field /via PMA or not/
    CREATE TABLE `test_pma_error` (
    `id` int(10) UNSIGNED NOT NULL,
    `jdata` json DEFAULT NULL
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  2. INSERT some row with valid JSON /via PMA or not/
    INSERT INTO `test_pma_error` (`id`,`jdata`) VALUES
    ('{"userName": "Al Han", "userNameOfSite": "11. Muenchen"}], "studyId": "499", "studyName": "EUT", "total_gtfo": "13", "total_enrolled": "336", "total_undecided": "41"}');
  3. Show table via phpMyAdmin menu

Expected behaviour

PMA to show table with no issues

Actual behaviour

Shows table with warnings Screenshot: http://prntscr.com/fwfk3z

Notice in ./libraries/dbi/DBIMysqli.class.php#522
 Undefined offset: 245

Backtrace

./libraries/DatabaseInterface.class.php#2971: PMA_DBI_Mysqli->getFieldsMeta(object)
./libraries/sql.lib.php#1777: PMA_DatabaseInterface->getFieldsMeta(object)
./libraries/sql.lib.php#2108: PMA_getQueryResponseForResultsReturned(
object,
array,
Notice in ./libraries/dbi/DBIMysqli.class.php#522
 Undefined offset: 245

Backtrace

./libraries/DatabaseInterface.class.php#2971: PMA_DBI_Mysqli->getFieldsMeta(object)
./libraries/sql.lib.php#1596: PMA_DatabaseInterface->getFieldsMeta(object)
./libraries/sql.lib.php#1902: PMA_getHtmlForSqlQueryResultsTable(
object,
string './themes/pmahomme/img/',

Server configuration

Operating system: 4.4.0-4-generic #19-Ubuntu SMP Fri Feb 5 17:39:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Web server: apache2

Database: :mysql Ver 14.14 Distrib 5.7.18, for Linux (x86_64)

PHP version: While PMA installataion, got this: Creating config file /etc/php/7.0/apache2/php.ini with new version ERROR: php5 module already enabled, not enabling PHP 7.0

PHP 7.0.18-0ubuntu0.16.04.1 (cli)

phpMyAdmin version: phpmyadmin all 4:4.5.4.1-2ubuntu2

Client configuration

Browser: Chrome Version 59.0.3071.115 (Official Build) (64-bit) Operating system: Windows 8.1

nijel commented 7 years ago

Please upgrade phpMyAdmin, this has been already fixed, see https://github.com/phpmyadmin/phpmyadmin/issues/12132.