Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument #1 ($offset) must be greater than or equal to 0 #16614

Closed
OlafvdSpek opened this issue Feb 3, 2021 · 4 comments · Fixed by #16633
Closed

Argument #1 ($offset) must be greater than or equal to 0 #16614

OlafvdSpek opened this issue Feb 3, 2021 · 4 comments · Fixed by #16633
Assignees
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
Milestone

Comments

@OlafvdSpek
Copy link

5.1.0-rc1
PHP 8.0.1

When trying to browse an empty table:

PHP message: PHP Fatal error:  Uncaught ValueError: mysqli_result::data_seek(): Argument #1 ($offset) must be greater than or equal to 0 in /srv/phpMyAdmin-5.1+snapshot-english/libraries/classes/Dbal/DbiMysqli.php:308
Stack trace:
#0 /srv/phpMyAdmin-5.1+snapshot-english/libraries/classes/Dbal/DbiMysqli.php(308): mysqli_result->data_seek()
#1 /srv/phpMyAdmin-5.1+snapshot-english/libraries/classes/DatabaseInterface.php(2036): PhpMyAdmin\Dbal\DbiMysqli->dataSeek()
#2 /srv/phpMyAdmin-5.1+snapshot-english/libraries/classes/Display/Results.php(4339): PhpMyAdmin\DatabaseInterface->dataSeek()
#3 /srv/phpMyAdmin-5.1+snapshot-english/libraries/classes/Display/Results.php(4070): PhpMyAdmin\Display\Results->getSortedColumnMessage()
#4 /srv/phpMyAdmin-5.1+snapshot-english/libraries/classes/Sql.php(1356): PhpMyAdmin\Display\Results->getTable()
#5 /srv/phpMyAdmin-5.1+snapshot-english/libraries/classes/Sql.php(1157): PhpMyAdmin\Sql->getHtmlForSqlQueryResultsTable()
#6 /srv/phpMyAdmin-5.1+snapshot-english/librarie
@williamdes williamdes added the Bug A problem or regression with an existing feature label Feb 3, 2021
@williamdes williamdes added this to Needs triage in issues via automation Feb 3, 2021
@williamdes williamdes moved this from Needs triage to PHP 8 in issues Feb 3, 2021
@williamdes williamdes added this to the 5.1.0 milestone Feb 3, 2021
@williamdes williamdes self-assigned this Feb 10, 2021
@williamdes williamdes added the has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete label Feb 10, 2021
williamdes added a commit to williamdes/phpmyadmintest that referenced this issue Feb 10, 2021
Fixes phpmyadmin#16614
Signed-off-by: William Desportes <williamdes@wdes.fr>
@ibennetch
Copy link
Member

Do you mean a table with no columns, or one that has columns but no data in it? I'm trying reproduce this and having trouble.

@RobertEcker
Copy link

RobertEcker commented Feb 15, 2021

I have the same problem with phpMyAdmin-5.1.0-rc2-all-languages

You can reproduce it with

CREATE TABLE `tbl_post` (
  `post_id` int(11) NOT NULL,
  `post_name` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


SELECT * FROM tbl_post ORDER BY post_id DESC

Fatal error: Uncaught ValueError: mysqli_result::data_seek(): Argument #1 ($offset) must be greater than or equal to 0
etc.

Without "ORDER BY post_id DESC" it works.

@williamdes
Copy link
Member

Deleting all the rows of the last page of a table did trigger this for me.

I created #16633 to fix that

@ibennetch
Copy link
Member

I've got it now, thank you.

williamdes added a commit that referenced this issue Feb 17, 2021
…ension

Pull-request: #16633
Fixes: #16614

Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Feb 17, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from PHP 8 to Closed Feb 17, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
issues
  
Closed
Development

Successfully merging a pull request may close this issue.

4 participants