Replies: 10 comments 2 replies
-
|
Beta Was this translation helpful? Give feedback.
-
@Jeckerson Sorry, 4.1.0 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Answer 2: If I use a limit to 2400 it works fine without any error. Answer 3: https://launchpad.net/~ondrej/+archive/ubuntu/php/ Answer 4:
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Might be related #15555 |
Beta Was this translation helpful? Give feedback.
-
@Jeckerson Sorry my bad, yes the problem is not in that code, it was in this code. ## previous code returns the long list of products.
$products = $this->queryCategoryProducts(
'\Product.cat_id = :cat_id: AND WEB_ITEM_ID IS NOT NULL',
['cat_id' => $category->cat_id]
);
$product_attributes = [];
$where_condition = '';
foreach ($products as $product) {
$where_condition .= '\ProductAttribute.product_id = ' . $product->product_id . ' OR ';
}
if (!empty($where_condition)) {
$where_condition = substr($where_condition, 0, -4); // remove trailing ' OR '
$this->logger->error($where_condition);
##
log output:
/*
\ProductAttribute.product_id = 4215 OR \ProductAttribute.product_id = 4471 OR \ProductAttribute.product_id = 4727 OR \ProductAttribute.product_id = 4983 OR \ProductAttribute.product_id = 5239 OR \ProductAttribute.product_id = 5495 OR \ProductAttribute.product_id = 2424 OR \ProductAttribute.product_id = 2680 OR \ProductAttribute.product_id = 2936 OR \ProductAttribute.product_id = 3192 OR \ProductAttribute.product_id = 3448 OR \ProductAttribute.product_id = 3704 OR \ProductAttribute.product_id = 3960 OR \ProductAttribute.product_id = 4216 OR \ProductAttribute.product_
*/
##
$product_attributes = ProductAttribute::query()
->columns([
'\ProductAttribute.product_id',
'\ProductAttribute.vorder',
'\AttributeValue.attribute_id',
'\AttributeValue.attribute_value_id',
'\AttributeValue.attribute_value_name'
])
->innerJoin('AttributeValue', "\ProductAttribute.attribute_value_id = \AttributeValue.attribute_value_id")
->where($where_condition)
->execute();
} Not sure but the code is throwing the segfault error If it uses the long where condition. Ans2: No afterFetch or any other events. |
Beta Was this translation helpful? Give feedback.
-
Try to use |
Beta Was this translation helpful? Give feedback.
-
$product_list = [];
foreach ($products as $product) {
array_push($product_list, $product->product_id);
}
if (!isset($product_list)) {
$product_attributes = ProductAttribute::query()
->columns([
'\ProductAttribute.product_id',
'\ProductAttribute.vorder',
'\AttributeValue.attribute_id',
'\AttributeValue.attribute_value_id',
'\AttributeValue.attribute_value_name'
])
->innerJoin('AttributeValue', "\ProductAttribute.attribute_value_id = \AttributeValue.attribute_value_id")
->where('\ProductAttribute.product_id IN :ids:')
->bind(['ids' => $product_list])
->execute();
} @Jeckerson Yes, It is working fine |
Beta Was this translation helpful? Give feedback.
-
@Jeckerson Out of curiosity? what is the problem using a long where clause? ran on MySQL console and it is working fine. |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Failing to execute a code that fetches 3000 records from the MySQL Database.
To Reproduce
Try to fetch 3000 records from the Database, Currently using MySQL
Expected behavior
Should Execute without any error
Details
php -v
): 7.4.23Additional context
Nginx logs
Php-fpm logs:
gdp traces:
Beta Was this translation helpful? Give feedback.
All reactions