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

Fatal error when creating an index #16769

Closed
liviuconcioiu opened this issue Mar 27, 2021 · 3 comments · Fixed by #17406
Closed

Fatal error when creating an index #16769

liviuconcioiu opened this issue Mar 27, 2021 · 3 comments · Fixed by #17406
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

@liviuconcioiu
Copy link
Contributor

liviuconcioiu commented Mar 27, 2021

Describe the bug

A fatal error is given when a index on 9223372036854775808 columns is created.

To Reproduce

Steps to reproduce the behavior:

  1. Go to any table structure
  2. Create an index on 9223372036854775808 columns
  3. See error

Expected behavior

The 9223372036854775808 number should be replaced with a smaller number.

Screenshots

error

Server configuration

  • Operating system: Windows
  • Web server: nginx/1.19.8
  • Database version: 5.7.32
  • PHP version: 8.0.3
  • phpMyAdmin version: 5.2.0-dev+20210326.fe41637a0d

Client configuration

  • Browser: Firefox
  • Operating system: Windows

Additional context

Fatal error:  Uncaught ValueError: The supplied range exceeds the maximum array size: start=1 end=9223372036854775807 in Z:\nginx-1.19.8\html\phpMyAdmin-5.2.0-dev\tmp\twig\cb\cbec66d4ec6642f8f36b48da8a324e1c1e37d9c0b396c35c715ff67cf5ae8005.php:350
Stack trace:
#0 Z:\nginx-1.19.8\html\phpMyAdmin-5.2.0-dev\tmp\twig\cb\cbec66d4ec6642f8f36b48da8a324e1c1e37d9c0b396c35c715ff67cf5ae8005.php(350): range(1, '922337203685477...')
#1 Z:\nginx-1.19.8\html\phpMyAdmin-5.2.0-dev\vendor\twig\twig\src\Template.php(394): __TwigTemplate_f3eb8b8cbf64c06cee7628be9cba6069094f2b1c47e46d1040b40edeba9e9598->doDisplay(Array, Array)
#2 Z:\nginx-1.19.8\html\phpMyAdmin-5.2.0-dev\vendor\twig\twig\src\Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
#3 Z:\nginx-1.19.8\html\phpMyAdmin-5.2.0-dev\vendor\twig\twig\src\Template.php(379): Twig\Template->display(Array)
#4 Z:\nginx-1.19.8\html\phpMyAdmin-5.2.0-dev\vendor\twig\twig\src\TemplateWrapper.php(40): Twig\Template->render(Array, Array)
#5 Z:\nginx-1.19.8\html\phpMyAdmin-5.2.0-dev\libraries\classes\Template.php(156): Twig\TemplateWrapper->render(Array)
#6 Z:\nginx-1.19.8\html\phpMyAdmin-5.2.0-dev\libraries\classes\Controllers\AbstractController.php(37): PhpMyAdmin\Template->render('table/index_for...', Array)
#7 Z:\nginx-1.19.8\html\phpMyAdmin-5.2.0-dev\libraries\classes\Controllers\Table\IndexesController.php(197): PhpMyAdmin\Controllers\AbstractController->render('table/index_for...', Array)
#8 Z:\nginx-1.19.8\html\phpMyAdmin-5.2.0-dev\libraries\classes\Controllers\Table\IndexesController.php(74): PhpMyAdmin\Controllers\Table\IndexesController->displayForm(Object(PhpMyAdmin\Index))
#9 Z:\nginx-1.19.8\html\phpMyAdmin-5.2.0-dev\libraries\classes\Routing.php(189): PhpMyAdmin\Controllers\Table\IndexesController->index(Array)
#10 Z:\nginx-1.19.8\html\phpMyAdmin-5.2.0-dev\index.php(18): PhpMyAdmin\Routing::callControllerForRoute('/table/indexes', Object(FastRoute\Dispatcher\GroupCountBased), Object(Symfony\Component\DependencyInjection\ContainerBuilder))
#11 {main}
  thrown in Z:\nginx-1.19.8\html\phpMyAdmin-5.2.0-dev\tmp\twig\cb\cbec66d4ec6642f8f36b48da8a324e1c1e37d9c0b396c35c715ff67cf5ae8005.php on line 350
@williamdes williamdes added the Bug A problem or regression with an existing feature label Mar 31, 2021
@williamdes williamdes added this to Needs triage in issues via automation Mar 31, 2021
@williamdes williamdes moved this from Needs triage to n/a priority in issues Mar 31, 2021
@rajat315315
Copy link
Contributor

Can you please explain 9223372036854775808 columns ?

@liviuconcioiu
Copy link
Contributor Author

Can you please explain 9223372036854775808 columns ?

Untitled

@liviuconcioiu
Copy link
Contributor Author

Also, creating an index on 223372036 columns, shows a out of memory error, on the same line.

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8589934600 bytes) in Z:\nginx\html\phpMyAdmin\tmp\twig\cb\cbec66d4ec6642f8f36b48da8a324e1c1e37d9c0b396c35c715ff67cf5ae8005.php on line 350

Untitled1

Line 350:
$context['_seq'] = twig_ensure_traversable(range(1, ($context["add_fields"] ?? null)));

MauricioFauth added a commit to MauricioFauth/phpmyadmin that referenced this issue Feb 19, 2022
- Fixes phpmyadmin#16769

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
@MauricioFauth MauricioFauth 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 19, 2022
@MauricioFauth MauricioFauth linked a pull request Feb 19, 2022 that will close this issue
@MauricioFauth MauricioFauth self-assigned this Feb 21, 2022
MauricioFauth added a commit that referenced this issue Feb 21, 2022
[ci skip]

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
issues automation moved this from n/a priority to Closed Feb 21, 2022
@MauricioFauth MauricioFauth added this to the 5.1.4 milestone Feb 21, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2023
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