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

ActiveRow: __isset 2.4.6 update masive increase DB information_schema queries count #203

Open
spagr opened this issue Aug 30, 2018 · 2 comments

Comments

@spagr
Copy link

spagr commented Aug 30, 2018

Version: 2.4.6

Bug Description

ActiveRow: __isset generate many queries from db information_schema if checked row doesn´t exist.
Attached screenshot shows the difference, left side browser with NDB 2.4.5, right side NDB 2.4.6, same code.

Use case in component with two data source handling :

// Cart Items handler
/** @var ActiveRow $product */
if (isset($product->sessid)) { // Cart table structure
  $quantity = $product->quantity;
  $product = $product->ref('product');
}

Expected Behavior

In version 2.4.5 (left browser) is expected behavior

image

@dg
Copy link
Member

dg commented Aug 30, 2018

related to #196 and @miranovy

@EdaCZ
Copy link
Contributor

EdaCZ commented Jul 24, 2019

@spagr Could you please provide full working example?

I tried to simulate it, but everything seems to be working fine.

For example, when I run test tests/Database/Table/bugs/ActiveRow.__isset.phpt and add another two assertions like this:

test(function () use ($context) {
	$row = $context->table('book')->get(2);
	Assert::same('Jakub Vrana', $row->author->name);
	Assert::true(isset($row->author->name));
	Assert::false(isset($row->author->test));
	Assert::false(isset($row->test));
});

For example function MySqlDriver.getForeignKeys and others are called only once for each table. And the whole structure is not reloaded.

There must be something special in your use case...

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