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

[BUG]: Mysql descripe indexes #16157

Closed
phptux opened this issue Oct 14, 2022 · 1 comment · Fixed by #16158
Closed

[BUG]: Mysql descripe indexes #16157

phptux opened this issue Oct 14, 2022 · 1 comment · Fixed by #16158
Assignees
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: medium Medium

Comments

@phptux
Copy link

phptux commented Oct 14, 2022

With the method Phalcon\Db\Adapter\Pdo\Mysql->describeIndexes() can I read the indexes for a database table. Internal create this method a Phalcon\Db\Index instance. If the index type NULL , then an error message:

Phalcon\Db\Index::__construct(): Passing null to parameter #3 ($type) of type string is deprecated

Backtrace:

Phalcon\Db\Index::__construct(): Passing null to parameter #3 ($type) of type string is deprecated:
#0 [internal function]: Azirax\Error\Runner->handleError(8192, '...', '...', 438)
#1 [internal function]: Phalcon\Db\Index->__construct('...', Array, NULL)
#2 /home/phptux/public_html/pmailer/application/libraries/Db/TableUpdater.php(438): Phalcon\Db\Adapter\Pdo\Mysql->describeIndexes('...', '...')
#3 /home/phptux/public_html/pmailer/application/libraries/Db/TableUpdater.php(307): Azirax\Db\TableUpdater->getIndexesFromDatabase()
#4 /home/phptux/public_html/pmailer/application/libraries/Db/TableUpdater.php(166): Azirax\Db\TableUpdater->modifyIndexes()
#5 /home/phptux/public_html/pmailer/application/libraries/Db/SchemaUpdater.php(462): Azirax\Db\TableUpdater->update()
#6 /home/phptux/public_html/pmailer/application/libraries/Db/SchemaUpdater.php(195): Azirax\Db\SchemaUpdater->getTableUpdater('...')
#7 /home/phptux/public_html/pmailer/application/commands/DatabaseCommand.php(86): Azirax\Db\SchemaUpdater->update()
#8 [internal function]: Azirax\Commands\DatabaseCommand->updateAction(NULL)
#9 /home/phptux/public_html/pmailer/application/libraries/Console/AbstractCommand.php(219): call_user_func_array(Array, Array)
#10 /home/phptux/public_html/pmailer/application/libraries/Application/CliApplication.php(113): Azirax\Console\AbstractCommand->dispatch()
#11 /home/phptux/public_html/pmailer/bin/azirax(28): Azirax\Application\CliApplication->send()
#12 {main}

In the class Phalcon\Db\Adapter\Pdo\Mysql->describeIndexes() in line 542:

let indexes[keyName]["type"] = null;

But the constructor from the class Phalcon\Db\Index required as third parameter only string.

    /**
     * Phalcon\Db\Index constructor
     */
    public function __construct(string! name, array! columns, string type = "")

Details

  • Phalcon version: 5.0.3
  • PHP Version: 8.1.11
  • Operating System: Linux Mint
  • Installation type: Compiling from source
  • Zephir version 0.16.2:
  • Server: Apache/2.4.54
  • Mysql: 8.0.30

I change the line in the class Phalcon\Db\Adapter\Pdo\Mysql->describeIndexes() 542 to:

let indexes[keyName]["type"] = "";

This work.

Regards phptux

@phptux phptux added bug A bug report status: unverified Unverified labels Oct 14, 2022
@niden niden self-assigned this Oct 15, 2022
@niden niden added status: medium Medium 5.0 The issues we want to solve in the 5.0 release and removed status: unverified Unverified labels Oct 15, 2022
@niden niden linked a pull request Oct 15, 2022 that will close this issue
5 tasks
@niden
Copy link
Member

niden commented Oct 15, 2022

Resolved in #16158

Thank you @phptux

@niden niden closed this as completed Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: medium Medium
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants