-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Batch query test #11152
base: master
Are you sure you want to change the base?
Batch query test #11152
Conversation
here is my environment:
|
with size = 100 000:
env (mysql running remote over VPN)
local libmysqlclient is also 18 |
With 1M it gets worse:
EDIT: 1M through local Mysql 5.6 is even worse:
|
Another machine with: PHP (no xdebug this time) MySql 5.6.29 (localhost), mysqlclient 18 Output:
EDIT: Adding a pure Debian machine (local mysql) to the list of failing ones:
Test results:
|
// tests/framework/db/BatchQueryResultTest.php
protected static $largeTableCount = 100000;
protected static $largeTableInsertBatch = 100000; ~ $ dpkg -l | grep -E 'mysql|percona'
ii libmysqlclient18:amd64 5.6.29-1~dotdeb+7.1 amd64 MySQL database client library
ii libperconaserverclient18.1 5.6.29-76.2-1.trusty amd64 Percona Server database client library
ii mysql-common 5.6.29-1~dotdeb+7.1 all MySQL database common files, e.g. /etc/mysql/my.cnf
ii percona-server-client-5.6 5.6.29-76.2-1.trusty amd64 Percona Server database client binaries
ii percona-server-common-5.6 5.6.29-76.2-1.trusty amd64 Percona Server database common files (e.g. /etc/mysql/my.cnf)
ii percona-server-server-5.6 5.6.29-76.2-1.trusty amd64 Percona Server database server binaries
ii php5-mysql 5.5.33-1~dotdeb+7.1 amd64 MySQL module for php5
~ $ php -v
PHP 5.5.33-1~dotdeb+7.1 (cli) (built: Mar 3 2016 17:11:35)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
with Xdebug v2.3.3, Copyright (c) 2002-2015, by Derick Rethans
~ $ mysql --version
mysql Ver 14.14 Distrib 5.6.29-76.2, for debian-linux-gnu (x86_64) using readline 6.3 Test: ~/www/yii2 $ phpunit tests/framework/db/BatchQueryResultTest.php
PHPUnit 4.8-g0fe5ed3 by Sebastian Bergmann and contributors.
Time: 8.43 minutes, Memory: 161.75Mb
There was 1 failure:
1) yiiunit\framework\db\BatchQueryResultTest::testBatchHugeTable with data set #0 (array(1))
Failed asserting that 142464504 is less than 34859560.
/home/GURTAM/loal/www/yii2/tests/framework/db/BatchQueryResultTest.php:191
/home/GURTAM/loal/www/yii2/vendor/phpunit/phpunit/phpunit:36
FAILURES!
Tests: 4, Assertions: 136047, Failures: 1. |
@cebe I think you should also add a test for batch queries using ActiveRecord. I found, that they currently don't work at all (unless you have the schema already cached by accident). See #8420 (comment). |
This adds a test for batch() and each() query with large table as some issues have been reported in the past. The default table will be created with 1000 records to not stress travis too much. You can try it locally by setting the table size to 100 000 or even 10 000 000.
I was not able to reproduce the problem with this test on my machine, maybe someone else can run it and see what happens.
/cc @particleflux can you try this test on your machine?