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

Cannot execute multiple queries #11

Closed
ka2le opened this issue Apr 10, 2018 · 3 comments
Closed

Cannot execute multiple queries #11

ka2le opened this issue Apr 10, 2018 · 3 comments

Comments

@ka2le
Copy link

ka2le commented Apr 10, 2018

Is this extension still compatible? I am using magento 2.1.0, Php 7.0.26 and mariadb 10.1.31

I created a report with the sql "select * from sales_order;" and get the following error:
I also tested with a couple of other queries but always get the same error.

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Cannot execute multiple queries

Exception #0 (Magento\Framework\Exception\LocalizedException): Cannot execute multiple queries
#0 /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(737): Magento\Framework\DB\Adapter\Pdo\Mysql->query(Object(Magento\Framework\DB\Select), Array)
#1 /var/www/html/lib/internal/Magento/Framework/Data/Collection/Db/FetchStrategy/Query.php(21): Zend_Db_Adapter_Abstract->fetchAll(Object(Magento\Framework\DB\Select), Array)
#2 /var/www/html/lib/internal/Magento/Framework/Data/Collection/AbstractDb.php(772): Magento\Framework\Data\Collection\Db\FetchStrategy\Query->fetchAll(Object(Magento\Framework\DB\Select), Array)
#3 /var/www/html/lib/internal/Magento/Framework/Data/Collection/AbstractDb.php(668): Magento\Framework\Data\Collection\AbstractDb->_fetchAll(Object(Magento\Framework\DB\Select))
#4 /var/www/html/lib/internal/Magento/Framework/Data/Collection/AbstractDb.php(572): Magento\Framework\Data\Collection\AbstractDb->getData()
#5 /var/www/html/lib/internal/Magento/Framework/Data/Collection/AbstractDb.php(557): Magento\Framework\Data\Collection\AbstractDb->loadWithFilter(false, false)
#6 /var/www/html/lib/internal/Magento/Framework/Data/Collection.php(300): Magento\Framework\Data\Collection\AbstractDb->load()
#7 /var/www/html/app/code/DEG/CustomReports/Block/Adminhtml/Report/Grid.php(42): Magento\Framework\Data\Collection->getFirstItem()
#8 /var/www/html/app/code/DEG/CustomReports/Block/Adminhtml/Report/Grid.php(30): DEG\CustomReports\Block\Adminhtml\Report\Grid->getColumnListFromCollection(Object(DEG\CustomReports\Model\GenericReportCollection))
#9 /var/www/html/lib/internal/Magento/Framework/View/Element/AbstractBlock.php(264): DEG\CustomReports\Block\Adminhtml\Report\Grid->_prepareLayout()
#10 /var/www/html/lib/internal/Magento/Framework/View/Layout.php(744): Magento\Framework\View\Element\AbstractBlock->setLayout(Object(Magento\Framework\View\Layout\Interceptor))
#11 /var/www/html/app/code/Magento/Backend/Block/Widget/Grid/Container.php(96): Magento\Framework\View\Layout->createBlock('DEG\CustomRepor...', 'adminhtml_repor...')
#12 /var/www/html/lib/internal/Magento/Framework/View/Element/AbstractBlock.php(264): Magento\Backend\Block\Widget\Grid\Container->_prepareLayout()
#13 /var/www/html/lib/internal/Magento/Framework/View/Layout/Generator/Block.php(139): Magento\Framework\View\Element\AbstractBlock->setLayout(Object(Magento\Framework\View\Layout\Interceptor))
#14 /var/www/html/lib/internal/Magento/Framework/View/Layout/GeneratorPool.php(86): Magento\Framework\View\Layout\Generator\Block->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#15 /var/www/html/lib/internal/Magento/Framework/View/Layout.php(327): Magento\Framework\View\Layout\GeneratorPool->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#16 /var/www/html/lib/internal/Magento/Framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout->generateElements()
#17 /var/www/html/lib/internal/Magento/Framework/View/Page/Builder.php(55): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
#18 /var/www/html/lib/internal/Magento/Framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()
#19 /var/www/html/lib/internal/Magento/Framework/View/Layout.php(244): Magento\Framework\View\Layout\Builder->build()
#20 /var/www/html/lib/internal/Magento/Framework/View/Layout.php(859): Magento\Framework\View\Layout->build()
#21 /var/www/html/app/code/Magento/Backend/Model/View/Result/Page.php(59): Magento\Framework\View\Layout->getBlock('menu')
#22 /var/www/html/app/code/DEG/CustomReports/Controller/Adminhtml/CustomReport/Report.php(37): Magento\Backend\Model\View\Result\Page->setActiveMenu('DEG_CustomRepor...')
#23 /var/www/html/lib/internal/Magento/Framework/App/Action/Action.php(102): DEG\CustomReports\Controller\Adminhtml\CustomReport\Report->execute()
#24 /var/www/html/app/code/Magento/Backend/App/AbstractAction.php(226): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#25 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(74): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
#26 /var/www/html/lib/internal/Magento/Framework/Interception/Chain/Chain.php(70): DEG\CustomReports\Controller\Adminhtml\CustomReport\Report\Interceptor->___callParent('dispatch', Array)
#27 /var/www/html/lib/internal/Magento/Framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('DEG\CustomRepor...', 'dispatch', Object(DEG\CustomReports\Controller\Adminhtml\CustomReport\Report\Interceptor), Array, 'adminAuthentica...')
#28 /var/www/html/app/code/Magento/Backend/App/Action/Plugin/Authentication.php(143): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain{closure}(Object(Magento\Framework\App\Request\Http))
#29 /var/www/html/lib/internal/Magento/Framework/Interception/Chain/Chain.php(67): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(DEG\CustomReports\Controller\Adminhtml\CustomReport\Report\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#30 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('DEG\CustomRepor...', 'dispatch', Object(DEG\CustomReports\Controller\Adminhtml\CustomReport\Report\Interceptor), Array, 'adminMassaction...')
#31 /var/www/html/app/code/Magento/Backend/App/Action/Plugin/MassactionKey.php(33): DEG\CustomReports\Controller\Adminhtml\CustomReport\Report\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#32 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(142): Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(DEG\CustomReports\Controller\Adminhtml\CustomReport\Report\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#33 /var/www/html/var/generation/DEG/CustomReports/Controller/Adminhtml/CustomReport/Report/Interceptor.php(26): DEG\CustomReports\Controller\Adminhtml\CustomReport\Report\Interceptor->___callPlugins('dispatch', Array, Array)
#34 /var/www/html/lib/internal/Magento/Framework/App/FrontController.php(55): DEG\CustomReports\Controller\Adminhtml\CustomReport\Report\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#35 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#36 /var/www/html/lib/internal/Magento/Framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#37 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#38 /var/www/html/lib/internal/Magento/Framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#39 /var/www/html/lib/internal/Magento/Framework/Interception/Interceptor.php(142): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#40 /var/www/html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#41 /var/www/html/lib/internal/Magento/Framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#42 /var/www/html/lib/internal/Magento/Framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#43 /var/www/html/index.php(49): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#44 {main}

@ka2le
Copy link
Author

ka2le commented Apr 10, 2018

Nevermind! I got it working by excluding the semicolon at the end of my sql-statement.

I'll leave this here if anyone has the same problem in the future.

@jantzenw
Copy link
Collaborator

jantzenw commented Feb 1, 2022

Sorry, this issue was not updated. This issue has since been resolved and trailing semicolons will not break reports.

@jantzenw jantzenw closed this as completed Feb 1, 2022
@Morettegustavo
Copy link

Morettegustavo commented Mar 31, 2023

Ele usa o primeiro campo para referenciar no order, adicione increment_id na primeira coluna que ele não dará erro. No meu caso havia dado erro porque eu havia usado AS e ele não entendia AS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants