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

Can’t place orders in Woo when HPOS is enabled #731

Closed
adamziel opened this issue Nov 5, 2023 · 5 comments
Closed

Can’t place orders in Woo when HPOS is enabled #731

adamziel opened this issue Nov 5, 2023 · 5 comments
Assignees
Labels
[Aspect] Sqlite [Type] Bug An existing feature does not function as intended

Comments

@adamziel
Copy link
Collaborator

adamziel commented Nov 5, 2023

High Performance Object Storage, which is enabled by default in Woo, does not work with Playground — presumably due to an SQLite-related issue.

@adamziel adamziel added the [Type] Bug An existing feature does not function as intended label Nov 5, 2023
@adamziel adamziel changed the title Can’t place orders in Woo when HPOS is enables Can’t place orders in Woo when HPOS is enabled Nov 5, 2023
@adamziel adamziel mentioned this issue Nov 22, 2023
11 tasks
@adamziel adamziel added this to the Zero Crashes milestone Feb 29, 2024
@bgrgicak bgrgicak self-assigned this May 17, 2024
@bgrgicak
Copy link
Collaborator

This is the error message I got on checkout (free product)

[17-May-2024 09:58:06 UTC] WordPress database error <div style="clear:both">&nbsp;</div>
<div class="queries" style="clear:both;margin-bottom:2px;border:red dotted thin;">
<p>MySQL query:</p>
<p>
INSERT INTO wp_wc_orders ( `billing_email`, `currency`, `customer_id`, `customer_note`, `date_created_gmt`, `date_updated_gmt`, `id`, `ip_address`, `parent_order_id`, `payment_method`, `payment_method_title`, `status`, `tax_amount`, `total_amount`, `transaction_id`, `type`, `user_agent` )
VALUES ( 'admin@localhost.com', 'ALL', 1, '', '2024-05-17 09:58:06', '2024-05-17 09:58:06', 16, '127.0.0.1', 0, '', '', 'wc-checkout-draft', 0.000000, 0.000000, '', 'shop_order', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36' )
ON DUPLICATE KEY UPDATE `billing_email` = VALUES( `billing_email` ), `currency` = VALUES( `currency` ), `customer_id` = VALUES( `customer_id` ), `customer_note` = VALUES( `customer_note` ), `date_created_gmt` = VALUES( `date_created_gmt` ), `date_updated_gmt` = VALUES( `date_updated_gmt` ), `id` = VALUES( `id` ), `ip_address` = VALUES( `ip_address` ), `parent_order_id` = VALUES( `parent_order_id` ), `payment_method` = VALUES( `payment_method` ), `payment_method_title` = VALUES( `payment_method_title` ), `status` = VALUES( `status` ), `tax_amount` = VALUES( `tax_amount` ), `total_amount` = VALUES( `total_amount` ), `transaction_id` = VALUES( `transaction_id` ), `type` = VALUES( `type` ), `user_agent` = VALUES( `user_agent` )
</p>
<p>Queries made or created this session were:</p>
<ol>
<li>Executing: BEGIN | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_table_info(:table_name) as l WHERE l.pk &gt; 0; | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_index_list(&quot;wp_wc_orders&quot;) as l; | (no parameters)</li>
<li>Executing: 
INSERT INTO wp_wc_orders ( `billing_email`, `currency`, `customer_id`, `customer_note`, `date_created_gmt`, `date_updated_gmt`, `id`, `ip_address`, `parent_order_id`, `payment_method`, `payment_method_title`, `status`, `tax_amount`, `total_amount`, `transaction_id`, `type`, `user_agent` )
VALUES ( :param0 , :param1 , 1, :param2 , :param3 , :param4 , 16, :param5 , 0, :param6 , :param7 , :param8 , 0.000000, 0.000000, :param9 , :param10 , :param11  )
ON   CONFLICT (&quot;id&quot;, ) DO UPDATE SET  `billing_email` = excluded. `billing_email` , `currency` = excluded. `currency` , `customer_id` = excluded. `customer_id` , `customer_note` = excluded. `customer_note` , `date_created_gmt` = excluded. `date_created_gmt` , `date_updated_gmt` = excluded. `date_updated_gmt` , `id` = excluded. `id` , `ip_address` = excluded. `ip_address` , `parent_order_id` = excluded. `parent_order_id` , `payment_method` = excluded. `payment_method` , `payment_method_title` = excluded. `payment_method_title` , `status` = excluded. `status` , `tax_amount` = excluded. `tax_amount` , `total_amount` = excluded. `total_amount` , `transaction_id` = excluded. `transaction_id` , `type` = excluded. `type` , `user_agent` = excluded. `user_agent` 
 | parameters: admin@localhost.com, ALL, , 2024-05-17 09:58:06, 2024-05-17 09:58:06, 127.0.0.1, , , wc-checkout-draft, , shop_order, Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36</li>
<li>Executing: ROLLBACK | (no parameters)</li>
</ol>
</div>
<div style="clear:both;margin-bottom:2px;border:red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;">
Error occurred at line 3776 in Function <code>handle_error</code>. Error message was: SQLSTATE[HY000]: General error: 1 near ")": syntax error.
</div>
<p>Backtrace:</p>
<pre>#0 /wordpress/wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(287): WP_SQLite_Translator->get_error_message()
#1 /wordpress/wp-content/plugins/woocommerce/src/Internal/Utilities/DatabaseUtil.php(268): WP_SQLite_DB->query('\nINSERT INTO wp...')
#2 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(1859): Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update('wp_wc_orders', Array, Array)
#3 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2534): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db(Object(WC_Order), false)
#4 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2491): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_save(Object(WC_Order))
#5 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(186): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->create(Object(WC_Order))
#6 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(214): WC_Data_Store->create(Object(WC_Order))
#7 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-order.php(252): WC_Abstract_Order->save()
#8 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(1875): WC_Order->save()
#9 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(1799): WC_Abstract_Order->update_taxes()
#10 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(1947): WC_Abstract_Order->calculate_taxes()
#11 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/OrderController.php(115): WC_Abstract_Order->calculate_totals()
#12 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/OrderController.php(50): Automattic\WooCommerce\StoreApi\Utilities\OrderController->update_order_from_cart(Object(WC_Order))
#13 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(331): Automattic\WooCommerce\StoreApi\Utilities\OrderController->create_order_from_cart()
#14 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(191): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->create_or_update_draft_order(Object(WP_REST_Request))
#15 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/AbstractRoute.php(121): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response(Object(WP_REST_Request))
#16 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(125): Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method(Object(WP_REST_Request))
#17 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response(Object(WP_REST_Request))
#18 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wc/store/v1/ch...', Array, NULL)
#19 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->dispatch(Object(WP_REST_Request))
#20 /wordpress/wp-includes/rest-api.php(2): WP_REST_Server->serve_request('/wc/store/v1/ch...')
#21 /wordpress/wp-includes/class-wp-hook.php(3): rest_api_loaded(Object(WP))
#22 /wordpress/wp-includes/class-wp-hook.php(3): WP_Hook->apply_filters(NULL, Array)
#23 /wordpress/wp-includes/plugin.php(2): WP_Hook->do_action(Array)
#24 /wordpress/wp-includes/class-wp.php(3): do_action_ref_array('parse_request', Array)
#25 /wordpress/wp-includes/class-wp.php(3): WP->parse_request('')
#26 /wordpress/wp-includes/functions.php(2): WP->main('')
#27 /wordpress/wp-blog-header.php(2): wp()
#28 /wordpress/index.php(2): require('/wordpress/wp-b...')
#29 {main}</pre>
 for query 
INSERT INTO wp_wc_orders ( `billing_email`, `currency`, `customer_id`, `customer_note`, `date_created_gmt`, `date_updated_gmt`, `id`, `ip_address`, `parent_order_id`, `payment_method`, `payment_method_title`, `status`, `tax_amount`, `total_amount`, `transaction_id`, `type`, `user_agent` )
VALUES ( 'admin@localhost.com', 'ALL', 1, '', '2024-05-17 09:58:06', '2024-05-17 09:58:06', 16, '127.0.0.1', 0, '', '', 'wc-checkout-draft', 0.000000, 0.000000, '', 'shop_order', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36' )
ON DUPLICATE KEY UPDATE `billing_email` = VALUES( `billing_email` ), `currency` = VALUES( `currency` ), `customer_id` = VALUES( `customer_id` ), `customer_note` = VALUES( `customer_note` ), `date_created_gmt` = VALUES( `date_created_gmt` ), `date_updated_gmt` = VALUES( `date_updated_gmt` ), `id` = VALUES( `id` ), `ip_address` = VALUES( `ip_address` ), `parent_order_id` = VALUES( `parent_order_id` ), `payment_method` = VALUES( `payment_method` ), `payment_method_title` = VALUES( `payment_method_title` ), `status` = VALUES( `status` ), `tax_amount` = VALUES( `tax_amount` ), `total_amount` = VALUES( `total_amount` ), `transaction_id` = VALUES( `transaction_id` ), `type` = VALUES( `type` ), `user_agent` = VALUES( `user_agent` )
 made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response, Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->create_or_update_draft_order, Automattic\WooCommerce\StoreApi\Utilities\OrderController->create_order_from_cart, Automattic\WooCommerce\StoreApi\Utilities\OrderController->update_order_from_cart, WC_Abstract_Order->calculate_totals, WC_Abstract_Order->calculate_taxes, WC_Abstract_Order->update_taxes, WC_Order->save, WC_Abstract_Order->save, WC_Data_Store->create, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->create, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_save, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db, Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update, WP_SQLite_DB->query, WP_SQLite_DB->print_error
[17-May-2024 09:58:06 UTC] WordPress database error <div style="clear:both">&nbsp;</div>
<div class="queries" style="clear:both;margin-bottom:2px;border:red dotted thin;">
<p>MySQL query:</p>
<p>
INSERT INTO wp_wc_order_operational_data ( `cart_hash`, `coupon_usages_are_counted`, `created_via`, `date_completed_gmt`, `date_paid_gmt`, `discount_tax_amount`, `discount_total_amount`, `download_permission_granted`, `new_order_email_sent`, `order_id`, `order_key`, `order_stock_reduced`, `prices_include_tax`, `recorded_sales`, `shipping_tax_amount`, `shipping_total_amount`, `woocommerce_version` )
VALUES ( '264e75b0669f315b4b307b0dfbb00b77', 0, 'store-api', NULL, NULL, 0.000000, 0.000000, 0, 0, 16, 'wc_order_M0ZaRR1boMedt', 0, 0, 0, 0.000000, 0.000000, '8.8.3' )
ON DUPLICATE KEY UPDATE `cart_hash` = VALUES( `cart_hash` ), `coupon_usages_are_counted` = VALUES( `coupon_usages_are_counted` ), `created_via` = VALUES( `created_via` ), `date_completed_gmt` = VALUES( `date_completed_gmt` ), `date_paid_gmt` = VALUES( `date_paid_gmt` ), `discount_tax_amount` = VALUES( `discount_tax_amount` ), `discount_total_amount` = VALUES( `discount_total_amount` ), `download_permission_granted` = VALUES( `download_permission_granted` ), `new_order_email_sent` = VALUES( `new_order_email_sent` ), `order_id` = VALUES( `order_id` ), `order_key` = VALUES( `order_key` ), `order_stock_reduced` = VALUES( `order_stock_reduced` ), `prices_include_tax` = VALUES( `prices_include_tax` ), `recorded_sales` = VALUES( `recorded_sales` ), `shipping_tax_amount` = VALUES( `shipping_tax_amount` ), `shipping_total_amount` = VALUES( `shipping_total_amount` ), `woocommerce_version` = VALUES( `woocommerce_version` )
</p>
<p>Queries made or created this session were:</p>
<ol>
<li>Executing: BEGIN | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_table_info(:table_name) as l WHERE l.pk &gt; 0; | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_index_list(&quot;wp_wc_order_operational_data&quot;) as l; | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_index_info(&quot;wp_wc_order_operational_data__order_id&quot;) as l; | (no parameters)</li>
<li>Executing: 
INSERT INTO wp_wc_order_operational_data ( `cart_hash`, `coupon_usages_are_counted`, `created_via`, `date_completed_gmt`, `date_paid_gmt`, `discount_tax_amount`, `discount_total_amount`, `download_permission_granted`, `new_order_email_sent`, `order_id`, `order_key`, `order_stock_reduced`, `prices_include_tax`, `recorded_sales`, `shipping_tax_amount`, `shipping_total_amount`, `woocommerce_version` )
VALUES ( :param0 , 0, :param1 , NULL, NULL, 0.000000, 0.000000, 0, 0, 16, :param2 , 0, 0, 0, 0.000000, 0.000000, :param3  )
ON   CONFLICT (&quot;order_id&quot;, ) DO UPDATE SET  `cart_hash` = excluded. `cart_hash` , `coupon_usages_are_counted` = excluded. `coupon_usages_are_counted` , `created_via` = excluded. `created_via` , `date_completed_gmt` = excluded. `date_completed_gmt` , `date_paid_gmt` = excluded. `date_paid_gmt` , `discount_tax_amount` = excluded. `discount_tax_amount` , `discount_total_amount` = excluded. `discount_total_amount` , `download_permission_granted` = excluded. `download_permission_granted` , `new_order_email_sent` = excluded. `new_order_email_sent` , `order_id` = excluded. `order_id` , `order_key` = excluded. `order_key` , `order_stock_reduced` = excluded. `order_stock_reduced` , `prices_include_tax` = excluded. `prices_include_tax` , `recorded_sales` = excluded. `recorded_sales` , `shipping_tax_amount` = excluded. `shipping_tax_amount` , `shipping_total_amount` = excluded. `shipping_total_amount` , `woocommerce_version` = excluded. `woocommerce_version` 
 | parameters: 264e75b0669f315b4b307b0dfbb00b77, store-api, wc_order_M0ZaRR1boMedt, 8.8.3</li>
<li>Executing: ROLLBACK | (no parameters)</li>
</ol>
</div>
<div style="clear:both;margin-bottom:2px;border:red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;">
Error occurred at line 3776 in Function <code>handle_error</code>. Error message was: SQLSTATE[HY000]: General error: 1 near ")": syntax error.
</div>
<p>Backtrace:</p>
<pre>#0 /wordpress/wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(287): WP_SQLite_Translator->get_error_message()
#1 /wordpress/wp-content/plugins/woocommerce/src/Internal/Utilities/DatabaseUtil.php(268): WP_SQLite_DB->query('\nINSERT INTO wp...')
#2 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(1859): Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update('wp_wc_order_ope...', Array, Array)
#3 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2534): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db(Object(WC_Order), false)
#4 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2491): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_save(Object(WC_Order))
#5 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(186): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->create(Object(WC_Order))
#6 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(214): WC_Data_Store->create(Object(WC_Order))
#7 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-order.php(252): WC_Abstract_Order->save()
#8 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(1875): WC_Order->save()
#9 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(1799): WC_Abstract_Order->update_taxes()
#10 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(1947): WC_Abstract_Order->calculate_taxes()
#11 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/OrderController.php(115): WC_Abstract_Order->calculate_totals()
#12 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/OrderController.php(50): Automattic\WooCommerce\StoreApi\Utilities\OrderController->update_order_from_cart(Object(WC_Order))
#13 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(331): Automattic\WooCommerce\StoreApi\Utilities\OrderController->create_order_from_cart()
#14 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(191): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->create_or_update_draft_order(Object(WP_REST_Request))
#15 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/AbstractRoute.php(121): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response(Object(WP_REST_Request))
#16 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(125): Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method(Object(WP_REST_Request))
#17 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response(Object(WP_REST_Request))
#18 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wc/store/v1/ch...', Array, NULL)
#19 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->dispatch(Object(WP_REST_Request))
#20 /wordpress/wp-includes/rest-api.php(2): WP_REST_Server->serve_request('/wc/store/v1/ch...')
#21 /wordpress/wp-includes/class-wp-hook.php(3): rest_api_loaded(Object(WP))
#22 /wordpress/wp-includes/class-wp-hook.php(3): WP_Hook->apply_filters(NULL, Array)
#23 /wordpress/wp-includes/plugin.php(2): WP_Hook->do_action(Array)
#24 /wordpress/wp-includes/class-wp.php(3): do_action_ref_array('parse_request', Array)
#25 /wordpress/wp-includes/class-wp.php(3): WP->parse_request('')
#26 /wordpress/wp-includes/functions.php(2): WP->main('')
#27 /wordpress/wp-blog-header.php(2): wp()
#28 /wordpress/index.php(2): require('/wordpress/wp-b...')
#29 {main}</pre>
 for query 
INSERT INTO wp_wc_order_operational_data ( `cart_hash`, `coupon_usages_are_counted`, `created_via`, `date_completed_gmt`, `date_paid_gmt`, `discount_tax_amount`, `discount_total_amount`, `download_permission_granted`, `new_order_email_sent`, `order_id`, `order_key`, `order_stock_reduced`, `prices_include_tax`, `recorded_sales`, `shipping_tax_amount`, `shipping_total_amount`, `woocommerce_version` )
VALUES ( '264e75b0669f315b4b307b0dfbb00b77', 0, 'store-api', NULL, NULL, 0.000000, 0.000000, 0, 0, 16, 'wc_order_M0ZaRR1boMedt', 0, 0, 0, 0.000000, 0.000000, '8.8.3' )
ON DUPLICATE KEY UPDATE `cart_hash` = VALUES( `cart_hash` ), `coupon_usages_are_counted` = VALUES( `coupon_usages_are_counted` ), `created_via` = VALUES( `created_via` ), `date_completed_gmt` = VALUES( `date_completed_gmt` ), `date_paid_gmt` = VALUES( `date_paid_gmt` ), `discount_tax_amount` = VALUES( `discount_tax_amount` ), `discount_total_amount` = VALUES( `discount_total_amount` ), `download_permission_granted` = VALUES( `download_permission_granted` ), `new_order_email_sent` = VALUES( `new_order_email_sent` ), `order_id` = VALUES( `order_id` ), `order_key` = VALUES( `order_key` ), `order_stock_reduced` = VALUES( `order_stock_reduced` ), `prices_include_tax` = VALUES( `prices_include_tax` ), `recorded_sales` = VALUES( `recorded_sales` ), `shipping_tax_amount` = VALUES( `shipping_tax_amount` ), `shipping_total_amount` = VALUES( `shipping_total_amount` ), `woocommerce_version` = VALUES( `woocommerce_version` )
 made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response, Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->create_or_update_draft_order, Automattic\WooCommerce\StoreApi\Utilities\OrderController->create_order_from_cart, Automattic\WooCommerce\StoreApi\Utilities\OrderController->update_order_from_cart, WC_Abstract_Order->calculate_totals, WC_Abstract_Order->calculate_taxes, WC_Abstract_Order->update_taxes, WC_Order->save, WC_Abstract_Order->save, WC_Data_Store->create, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->create, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_save, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db, Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update, WP_SQLite_DB->query, WP_SQLite_DB->print_error
[17-May-2024 09:58:06 UTC] WordPress database error <div style="clear:both">&nbsp;</div>
<div class="queries" style="clear:both;margin-bottom:2px;border:red dotted thin;">
<p>MySQL query:</p>
<p>
INSERT INTO wp_wc_order_addresses ( `address_1`, `address_type`, `city`, `country`, `email`, `first_name`, `last_name`, `order_id`, `phone`, `postcode`, `state` )
VALUES ( 'Donja Jelsa 164', 'billing', 'Karlovac', 'US', 'admin@localhost.com', 'Berislav', 'Grgičak', 16, '0998042809', '47000', 'CA' )
ON DUPLICATE KEY UPDATE `address_1` = VALUES( `address_1` ), `address_type` = VALUES( `address_type` ), `city` = VALUES( `city` ), `country` = VALUES( `country` ), `email` = VALUES( `email` ), `first_name` = VALUES( `first_name` ), `last_name` = VALUES( `last_name` ), `order_id` = VALUES( `order_id` ), `phone` = VALUES( `phone` ), `postcode` = VALUES( `postcode` ), `state` = VALUES( `state` )
</p>
<p>Queries made or created this session were:</p>
<ol>
<li>Executing: BEGIN | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_table_info(:table_name) as l WHERE l.pk &gt; 0; | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_index_list(&quot;wp_wc_order_addresses&quot;) as l; | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_index_info(&quot;wp_wc_order_addresses__address_type_order_id&quot;) as l; | (no parameters)</li>
<li>Executing: 
INSERT INTO wp_wc_order_addresses ( `address_1`, `address_type`, `city`, `country`, `email`, `first_name`, `last_name`, `order_id`, `phone`, `postcode`, `state` )
VALUES ( :param0 , :param1 , :param2 , :param3 , :param4 , :param5 , :param6 , 16, :param7 , :param8 , :param9  )
ON   CONFLICT (&quot;address_type&quot;&quot;order_id&quot;, ) DO UPDATE SET  `address_1` = excluded. `address_1` , `address_type` = excluded. `address_type` , `city` = excluded. `city` , `country` = excluded. `country` , `email` = excluded. `email` , `first_name` = excluded. `first_name` , `last_name` = excluded. `last_name` , `order_id` = excluded. `order_id` , `phone` = excluded. `phone` , `postcode` = excluded. `postcode` , `state` = excluded. `state` 
 | parameters: Donja Jelsa 164, billing, Karlovac, US, admin@localhost.com, Berislav, Grgičak, 0998042809, 47000, CA</li>
<li>Executing: ROLLBACK | (no parameters)</li>
</ol>
</div>
<div style="clear:both;margin-bottom:2px;border:red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;">
Error occurred at line 3776 in Function <code>handle_error</code>. Error message was: SQLSTATE[HY000]: General error: 1 near ")": syntax error.
</div>
<p>Backtrace:</p>
<pre>#0 /wordpress/wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(287): WP_SQLite_Translator->get_error_message()
#1 /wordpress/wp-content/plugins/woocommerce/src/Internal/Utilities/DatabaseUtil.php(268): WP_SQLite_DB->query('\nINSERT INTO wp...')
#2 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(1859): Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update('wp_wc_order_add...', Array, Array)
#3 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2534): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db(Object(WC_Order), false)
#4 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2491): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_save(Object(WC_Order))
#5 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(186): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->create(Object(WC_Order))
#6 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(214): WC_Data_Store->create(Object(WC_Order))
#7 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-order.php(252): WC_Abstract_Order->save()
#8 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(1875): WC_Order->save()
#9 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(1799): WC_Abstract_Order->update_taxes()
#10 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(1947): WC_Abstract_Order->calculate_taxes()
#11 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/OrderController.php(115): WC_Abstract_Order->calculate_totals()
#12 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/OrderController.php(50): Automattic\WooCommerce\StoreApi\Utilities\OrderController->update_order_from_cart(Object(WC_Order))
#13 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(331): Automattic\WooCommerce\StoreApi\Utilities\OrderController->create_order_from_cart()
#14 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(191): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->create_or_update_draft_order(Object(WP_REST_Request))
#15 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/AbstractRoute.php(121): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response(Object(WP_REST_Request))
#16 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(125): Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method(Object(WP_REST_Request))
#17 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response(Object(WP_REST_Request))
#18 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wc/store/v1/ch...', Array, NULL)
#19 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->dispatch(Object(WP_REST_Request))
#20 /wordpress/wp-includes/rest-api.php(2): WP_REST_Server->serve_request('/wc/store/v1/ch...')
#21 /wordpress/wp-includes/class-wp-hook.php(3): rest_api_loaded(Object(WP))
#22 /wordpress/wp-includes/class-wp-hook.php(3): WP_Hook->apply_filters(NULL, Array)
#23 /wordpress/wp-includes/plugin.php(2): WP_Hook->do_action(Array)
#24 /wordpress/wp-includes/class-wp.php(3): do_action_ref_array('parse_request', Array)
#25 /wordpress/wp-includes/class-wp.php(3): WP->parse_request('')
#26 /wordpress/wp-includes/functions.php(2): WP->main('')
#27 /wordpress/wp-blog-header.php(2): wp()
#28 /wordpress/index.php(2): require('/wordpress/wp-b...')
#29 {main}</pre>
 for query 
INSERT INTO wp_wc_order_addresses ( `address_1`, `address_type`, `city`, `country`, `email`, `first_name`, `last_name`, `order_id`, `phone`, `postcode`, `state` )
VALUES ( 'Donja Jelsa 164', 'billing', 'Karlovac', 'US', 'admin@localhost.com', 'Berislav', 'Grgičak', 16, '0998042809', '47000', 'CA' )
ON DUPLICATE KEY UPDATE `address_1` = VALUES( `address_1` ), `address_type` = VALUES( `address_type` ), `city` = VALUES( `city` ), `country` = VALUES( `country` ), `email` = VALUES( `email` ), `first_name` = VALUES( `first_name` ), `last_name` = VALUES( `last_name` ), `order_id` = VALUES( `order_id` ), `phone` = VALUES( `phone` ), `postcode` = VALUES( `postcode` ), `state` = VALUES( `state` )
 made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response, Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->create_or_update_draft_order, Automattic\WooCommerce\StoreApi\Utilities\OrderController->create_order_from_cart, Automattic\WooCommerce\StoreApi\Utilities\OrderController->update_order_from_cart, WC_Abstract_Order->calculate_totals, WC_Abstract_Order->calculate_taxes, WC_Abstract_Order->update_taxes, WC_Order->save, WC_Abstract_Order->save, WC_Data_Store->create, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->create, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_save, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db, Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update, WP_SQLite_DB->query, WP_SQLite_DB->print_error
[17-May-2024 09:58:06 UTC] WordPress database error <div style="clear:both">&nbsp;</div>
<div class="queries" style="clear:both;margin-bottom:2px;border:red dotted thin;">
<p>MySQL query:</p>
<p>
INSERT INTO wp_wc_order_addresses ( `address_1`, `address_type`, `city`, `country`, `first_name`, `last_name`, `order_id`, `phone`, `postcode`, `state` )
VALUES ( 'Donja Jelsa 164', 'shipping', 'Karlovac', 'US', 'Berislav', 'Grgičak', 16, '0998042809', '47000', 'CA' )
ON DUPLICATE KEY UPDATE `address_1` = VALUES( `address_1` ), `address_type` = VALUES( `address_type` ), `city` = VALUES( `city` ), `country` = VALUES( `country` ), `first_name` = VALUES( `first_name` ), `last_name` = VALUES( `last_name` ), `order_id` = VALUES( `order_id` ), `phone` = VALUES( `phone` ), `postcode` = VALUES( `postcode` ), `state` = VALUES( `state` )
</p>
<p>Queries made or created this session were:</p>
<ol>
<li>Executing: BEGIN | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_table_info(:table_name) as l WHERE l.pk &gt; 0; | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_index_list(&quot;wp_wc_order_addresses&quot;) as l; | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_index_info(&quot;wp_wc_order_addresses__address_type_order_id&quot;) as l; | (no parameters)</li>
<li>Executing: 
INSERT INTO wp_wc_order_addresses ( `address_1`, `address_type`, `city`, `country`, `first_name`, `last_name`, `order_id`, `phone`, `postcode`, `state` )
VALUES ( :param0 , :param1 , :param2 , :param3 , :param4 , :param5 , 16, :param6 , :param7 , :param8  )
ON   CONFLICT (&quot;address_type&quot;&quot;order_id&quot;, ) DO UPDATE SET  `address_1` = excluded. `address_1` , `address_type` = excluded. `address_type` , `city` = excluded. `city` , `country` = excluded. `country` , `first_name` = excluded. `first_name` , `last_name` = excluded. `last_name` , `order_id` = excluded. `order_id` , `phone` = excluded. `phone` , `postcode` = excluded. `postcode` , `state` = excluded. `state` 
 | parameters: Donja Jelsa 164, shipping, Karlovac, US, Berislav, Grgičak, 0998042809, 47000, CA</li>
<li>Executing: ROLLBACK | (no parameters)</li>
</ol>
</div>
<div style="clear:both;margin-bottom:2px;border:red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;">
Error occurred at line 3776 in Function <code>handle_error</code>. Error message was: SQLSTATE[HY000]: General error: 1 near ")": syntax error.
</div>
<p>Backtrace:</p>
<pre>#0 /wordpress/wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(287): WP_SQLite_Translator->get_error_message()
#1 /wordpress/wp-content/plugins/woocommerce/src/Internal/Utilities/DatabaseUtil.php(268): WP_SQLite_DB->query('\nINSERT INTO wp...')
#2 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(1859): Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update('wp_wc_order_add...', Array, Array)
#3 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2534): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db(Object(WC_Order), false)
#4 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2491): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_save(Object(WC_Order))
#5 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(186): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->create(Object(WC_Order))
#6 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(214): WC_Data_Store->create(Object(WC_Order))
#7 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-order.php(252): WC_Abstract_Order->save()
#8 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(1875): WC_Order->save()
#9 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(1799): WC_Abstract_Order->update_taxes()
#10 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(1947): WC_Abstract_Order->calculate_taxes()
#11 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/OrderController.php(115): WC_Abstract_Order->calculate_totals()
#12 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/OrderController.php(50): Automattic\WooCommerce\StoreApi\Utilities\OrderController->update_order_from_cart(Object(WC_Order))
#13 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(331): Automattic\WooCommerce\StoreApi\Utilities\OrderController->create_order_from_cart()
#14 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(191): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->create_or_update_draft_order(Object(WP_REST_Request))
#15 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/AbstractRoute.php(121): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response(Object(WP_REST_Request))
#16 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(125): Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method(Object(WP_REST_Request))
#17 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response(Object(WP_REST_Request))
#18 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wc/store/v1/ch...', Array, NULL)
#19 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->dispatch(Object(WP_REST_Request))
#20 /wordpress/wp-includes/rest-api.php(2): WP_REST_Server->serve_request('/wc/store/v1/ch...')
#21 /wordpress/wp-includes/class-wp-hook.php(3): rest_api_loaded(Object(WP))
#22 /wordpress/wp-includes/class-wp-hook.php(3): WP_Hook->apply_filters(NULL, Array)
#23 /wordpress/wp-includes/plugin.php(2): WP_Hook->do_action(Array)
#24 /wordpress/wp-includes/class-wp.php(3): do_action_ref_array('parse_request', Array)
#25 /wordpress/wp-includes/class-wp.php(3): WP->parse_request('')
#26 /wordpress/wp-includes/functions.php(2): WP->main('')
#27 /wordpress/wp-blog-header.php(2): wp()
#28 /wordpress/index.php(2): require('/wordpress/wp-b...')
#29 {main}</pre>
 for query 
INSERT INTO wp_wc_order_addresses ( `address_1`, `address_type`, `city`, `country`, `first_name`, `last_name`, `order_id`, `phone`, `postcode`, `state` )
VALUES ( 'Donja Jelsa 164', 'shipping', 'Karlovac', 'US', 'Berislav', 'Grgičak', 16, '0998042809', '47000', 'CA' )
ON DUPLICATE KEY UPDATE `address_1` = VALUES( `address_1` ), `address_type` = VALUES( `address_type` ), `city` = VALUES( `city` ), `country` = VALUES( `country` ), `first_name` = VALUES( `first_name` ), `last_name` = VALUES( `last_name` ), `order_id` = VALUES( `order_id` ), `phone` = VALUES( `phone` ), `postcode` = VALUES( `postcode` ), `state` = VALUES( `state` )
 made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response, Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->create_or_update_draft_order, Automattic\WooCommerce\StoreApi\Utilities\OrderController->create_order_from_cart, Automattic\WooCommerce\StoreApi\Utilities\OrderController->update_order_from_cart, WC_Abstract_Order->calculate_totals, WC_Abstract_Order->calculate_taxes, WC_Abstract_Order->update_taxes, WC_Order->save, WC_Abstract_Order->save, WC_Data_Store->create, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->create, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_save, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db, Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update, WP_SQLite_DB->query, WP_SQLite_DB->print_error
[17-May-2024 09:58:06 UTC] WordPress database error <div style="clear:both">&nbsp;</div>
<div class="queries" style="clear:both;margin-bottom:2px;border:red dotted thin;">
<p>MySQL query:</p>
<p>
INSERT INTO wp_wc_orders ( `date_updated_gmt`, `id`, `total_amount`, `type` )
VALUES ( '2024-05-17 09:58:06', 16, 0.000000, 'shop_order' )
ON DUPLICATE KEY UPDATE `date_updated_gmt` = VALUES( `date_updated_gmt` ), `id` = VALUES( `id` ), `total_amount` = VALUES( `total_amount` ), `type` = VALUES( `type` )
</p>
<p>Queries made or created this session were:</p>
<ol>
<li>Executing: BEGIN | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_table_info(:table_name) as l WHERE l.pk &gt; 0; | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_index_list(&quot;wp_wc_orders&quot;) as l; | (no parameters)</li>
<li>Executing: 
INSERT INTO wp_wc_orders ( `date_updated_gmt`, `id`, `total_amount`, `type` )
VALUES ( :param0 , 16, 0.000000, :param1  )
ON   CONFLICT (&quot;id&quot;, ) DO UPDATE SET  `date_updated_gmt` = excluded. `date_updated_gmt` , `id` = excluded. `id` , `total_amount` = excluded. `total_amount` , `type` = excluded. `type` 
 | parameters: 2024-05-17 09:58:06, shop_order</li>
<li>Executing: ROLLBACK | (no parameters)</li>
</ol>
</div>
<div style="clear:both;margin-bottom:2px;border:red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;">
Error occurred at line 3776 in Function <code>handle_error</code>. Error message was: SQLSTATE[HY000]: General error: 1 near ")": syntax error.
</div>
<p>Backtrace:</p>
<pre>#0 /wordpress/wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(287): WP_SQLite_Translator->get_error_message()
#1 /wordpress/wp-content/plugins/woocommerce/src/Internal/Utilities/DatabaseUtil.php(268): WP_SQLite_DB->query('\nINSERT INTO wp...')
#2 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(1859): Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update('wp_wc_orders', Array, Array)
#3 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2638): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db(Object(WC_Order))
#4 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2576): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_updates(Object(WC_Order))
#5 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(196): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->update(Object(WC_Order))
#6 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(212): WC_Data_Store->update(Object(WC_Order))
#7 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-order.php(252): WC_Abstract_Order->save()
#8 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(1969): WC_Order->save()
#9 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/OrderController.php(115): WC_Abstract_Order->calculate_totals()
#10 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/OrderController.php(50): Automattic\WooCommerce\StoreApi\Utilities\OrderController->update_order_from_cart(Object(WC_Order))
#11 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(331): Automattic\WooCommerce\StoreApi\Utilities\OrderController->create_order_from_cart()
#12 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(191): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->create_or_update_draft_order(Object(WP_REST_Request))
#13 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/AbstractRoute.php(121): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response(Object(WP_REST_Request))
#14 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(125): Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method(Object(WP_REST_Request))
#15 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response(Object(WP_REST_Request))
#16 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wc/store/v1/ch...', Array, NULL)
#17 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->dispatch(Object(WP_REST_Request))
#18 /wordpress/wp-includes/rest-api.php(2): WP_REST_Server->serve_request('/wc/store/v1/ch...')
#19 /wordpress/wp-includes/class-wp-hook.php(3): rest_api_loaded(Object(WP))
#20 /wordpress/wp-includes/class-wp-hook.php(3): WP_Hook->apply_filters(NULL, Array)
#21 /wordpress/wp-includes/plugin.php(2): WP_Hook->do_action(Array)
#22 /wordpress/wp-includes/class-wp.php(3): do_action_ref_array('parse_request', Array)
#23 /wordpress/wp-includes/class-wp.php(3): WP->parse_request('')
#24 /wordpress/wp-includes/functions.php(2): WP->main('')
#25 /wordpress/wp-blog-header.php(2): wp()
#26 /wordpress/index.php(2): require('/wordpress/wp-b...')
#27 {main}</pre>
 for query 
INSERT INTO wp_wc_orders ( `date_updated_gmt`, `id`, `total_amount`, `type` )
VALUES ( '2024-05-17 09:58:06', 16, 0.000000, 'shop_order' )
ON DUPLICATE KEY UPDATE `date_updated_gmt` = VALUES( `date_updated_gmt` ), `id` = VALUES( `id` ), `total_amount` = VALUES( `total_amount` ), `type` = VALUES( `type` )
 made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response, Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->create_or_update_draft_order, Automattic\WooCommerce\StoreApi\Utilities\OrderController->create_order_from_cart, Automattic\WooCommerce\StoreApi\Utilities\OrderController->update_order_from_cart, WC_Abstract_Order->calculate_totals, WC_Order->save, WC_Abstract_Order->save, WC_Data_Store->update, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->update, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_updates, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db, Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update, WP_SQLite_DB->query, WP_SQLite_DB->print_error
[17-May-2024 09:58:06 UTC] WordPress database error <div style="clear:both">&nbsp;</div>
<div class="queries" style="clear:both;margin-bottom:2px;border:red dotted thin;">
<p>MySQL query:</p>
<p>
INSERT INTO wp_wc_order_operational_data ( `discount_tax_amount`, `discount_total_amount`, `order_id` )
VALUES ( 0.000000, 0.000000, 16 )
ON DUPLICATE KEY UPDATE `discount_tax_amount` = VALUES( `discount_tax_amount` ), `discount_total_amount` = VALUES( `discount_total_amount` ), `order_id` = VALUES( `order_id` )
</p>
<p>Queries made or created this session were:</p>
<ol>
<li>Executing: BEGIN | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_table_info(:table_name) as l WHERE l.pk &gt; 0; | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_index_list(&quot;wp_wc_order_operational_data&quot;) as l; | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_index_info(&quot;wp_wc_order_operational_data__order_id&quot;) as l; | (no parameters)</li>
<li>Executing: 
INSERT INTO wp_wc_order_operational_data ( `discount_tax_amount`, `discount_total_amount`, `order_id` )
VALUES ( 0.000000, 0.000000, 16 )
ON   CONFLICT (&quot;order_id&quot;, ) DO UPDATE SET  `discount_tax_amount` = excluded. `discount_tax_amount` , `discount_total_amount` = excluded. `discount_total_amount` , `order_id` = excluded. `order_id` 
 | (no parameters)</li>
<li>Executing: ROLLBACK | (no parameters)</li>
</ol>
</div>
<div style="clear:both;margin-bottom:2px;border:red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;">
Error occurred at line 3776 in Function <code>handle_error</code>. Error message was: SQLSTATE[HY000]: General error: 1 near ")": syntax error.
</div>
<p>Backtrace:</p>
<pre>#0 /wordpress/wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(287): WP_SQLite_Translator->get_error_message()
#1 /wordpress/wp-content/plugins/woocommerce/src/Internal/Utilities/DatabaseUtil.php(268): WP_SQLite_DB->query('\nINSERT INTO wp...')
#2 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(1859): Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update('wp_wc_order_ope...', Array, Array)
#3 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2638): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db(Object(WC_Order))
#4 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2576): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_updates(Object(WC_Order))
#5 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(196): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->update(Object(WC_Order))
#6 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(212): WC_Data_Store->update(Object(WC_Order))
#7 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-order.php(252): WC_Abstract_Order->save()
#8 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(1969): WC_Order->save()
#9 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/OrderController.php(115): WC_Abstract_Order->calculate_totals()
#10 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/OrderController.php(50): Automattic\WooCommerce\StoreApi\Utilities\OrderController->update_order_from_cart(Object(WC_Order))
#11 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(331): Automattic\WooCommerce\StoreApi\Utilities\OrderController->create_order_from_cart()
#12 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(191): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->create_or_update_draft_order(Object(WP_REST_Request))
#13 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/AbstractRoute.php(121): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response(Object(WP_REST_Request))
#14 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(125): Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method(Object(WP_REST_Request))
#15 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response(Object(WP_REST_Request))
#16 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wc/store/v1/ch...', Array, NULL)
#17 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->dispatch(Object(WP_REST_Request))
#18 /wordpress/wp-includes/rest-api.php(2): WP_REST_Server->serve_request('/wc/store/v1/ch...')
#19 /wordpress/wp-includes/class-wp-hook.php(3): rest_api_loaded(Object(WP))
#20 /wordpress/wp-includes/class-wp-hook.php(3): WP_Hook->apply_filters(NULL, Array)
#21 /wordpress/wp-includes/plugin.php(2): WP_Hook->do_action(Array)
#22 /wordpress/wp-includes/class-wp.php(3): do_action_ref_array('parse_request', Array)
#23 /wordpress/wp-includes/class-wp.php(3): WP->parse_request('')
#24 /wordpress/wp-includes/functions.php(2): WP->main('')
#25 /wordpress/wp-blog-header.php(2): wp()
#26 /wordpress/index.php(2): require('/wordpress/wp-b...')
#27 {main}</pre>
 for query 
INSERT INTO wp_wc_order_operational_data ( `discount_tax_amount`, `discount_total_amount`, `order_id` )
VALUES ( 0.000000, 0.000000, 16 )
ON DUPLICATE KEY UPDATE `discount_tax_amount` = VALUES( `discount_tax_amount` ), `discount_total_amount` = VALUES( `discount_total_amount` ), `order_id` = VALUES( `order_id` )
 made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response, Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->create_or_update_draft_order, Automattic\WooCommerce\StoreApi\Utilities\OrderController->create_order_from_cart, Automattic\WooCommerce\StoreApi\Utilities\OrderController->update_order_from_cart, WC_Abstract_Order->calculate_totals, WC_Order->save, WC_Abstract_Order->save, WC_Data_Store->update, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->update, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_updates, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db, Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update, WP_SQLite_DB->query, WP_SQLite_DB->print_error
[17-May-2024 09:58:06 UTC] WordPress database error <div style="clear:both">&nbsp;</div>
<div class="queries" style="clear:both;margin-bottom:2px;border:red dotted thin;">
<p>MySQL query:</p>
<p>
INSERT INTO wp_wc_orders ( `date_updated_gmt`, `id`, `type` )
VALUES ( '2024-05-17 09:58:06', 16, 'shop_order' )
ON DUPLICATE KEY UPDATE `date_updated_gmt` = VALUES( `date_updated_gmt` ), `id` = VALUES( `id` ), `type` = VALUES( `type` )
</p>
<p>Queries made or created this session were:</p>
<ol>
<li>Executing: BEGIN | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_table_info(:table_name) as l WHERE l.pk &gt; 0; | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_index_list(&quot;wp_wc_orders&quot;) as l; | (no parameters)</li>
<li>Executing: 
INSERT INTO wp_wc_orders ( `date_updated_gmt`, `id`, `type` )
VALUES ( :param0 , 16, :param1  )
ON   CONFLICT (&quot;id&quot;, ) DO UPDATE SET  `date_updated_gmt` = excluded. `date_updated_gmt` , `id` = excluded. `id` , `type` = excluded. `type` 
 | parameters: 2024-05-17 09:58:06, shop_order</li>
<li>Executing: ROLLBACK | (no parameters)</li>
</ol>
</div>
<div style="clear:both;margin-bottom:2px;border:red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;">
Error occurred at line 3776 in Function <code>handle_error</code>. Error message was: SQLSTATE[HY000]: General error: 1 near ")": syntax error.
</div>
<p>Backtrace:</p>
<pre>#0 /wordpress/wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(287): WP_SQLite_Translator->get_error_message()
#1 /wordpress/wp-content/plugins/woocommerce/src/Internal/Utilities/DatabaseUtil.php(268): WP_SQLite_DB->query('\nINSERT INTO wp...')
#2 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(1859): Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update('wp_wc_orders', Array, Array)
#3 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2638): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db(Object(WC_Order))
#4 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2576): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_updates(Object(WC_Order))
#5 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(196): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->update(Object(WC_Order))
#6 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(212): WC_Data_Store->update(Object(WC_Order))
#7 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-order.php(252): WC_Abstract_Order->save()
#8 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/CheckoutTrait.php(170): WC_Order->save()
#9 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(192): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->update_order_from_request(Object(WP_REST_Request))
#10 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/AbstractRoute.php(121): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response(Object(WP_REST_Request))
#11 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(125): Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method(Object(WP_REST_Request))
#12 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response(Object(WP_REST_Request))
#13 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wc/store/v1/ch...', Array, NULL)
#14 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->dispatch(Object(WP_REST_Request))
#15 /wordpress/wp-includes/rest-api.php(2): WP_REST_Server->serve_request('/wc/store/v1/ch...')
#16 /wordpress/wp-includes/class-wp-hook.php(3): rest_api_loaded(Object(WP))
#17 /wordpress/wp-includes/class-wp-hook.php(3): WP_Hook->apply_filters(NULL, Array)
#18 /wordpress/wp-includes/plugin.php(2): WP_Hook->do_action(Array)
#19 /wordpress/wp-includes/class-wp.php(3): do_action_ref_array('parse_request', Array)
#20 /wordpress/wp-includes/class-wp.php(3): WP->parse_request('')
#21 /wordpress/wp-includes/functions.php(2): WP->main('')
#22 /wordpress/wp-blog-header.php(2): wp()
#23 /wordpress/index.php(2): require('/wordpress/wp-b...')
#24 {main}</pre>
 for query 
INSERT INTO wp_wc_orders ( `date_updated_gmt`, `id`, `type` )
VALUES ( '2024-05-17 09:58:06', 16, 'shop_order' )
ON DUPLICATE KEY UPDATE `date_updated_gmt` = VALUES( `date_updated_gmt` ), `id` = VALUES( `id` ), `type` = VALUES( `type` )
 made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response, Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->update_order_from_request, WC_Order->save, WC_Abstract_Order->save, WC_Data_Store->update, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->update, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_updates, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db, Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update, WP_SQLite_DB->query, WP_SQLite_DB->print_error
[17-May-2024 09:58:06 UTC] WordPress database error <div style="clear:both">&nbsp;</div>
<div class="queries" style="clear:both;margin-bottom:2px;border:red dotted thin;">
<p>MySQL query:</p>
<p>
INSERT INTO wp_wc_orders ( `date_updated_gmt`, `id`, `status`, `type` )
VALUES ( '2024-05-17 09:58:06', 16, 'wc-pending', 'shop_order' )
ON DUPLICATE KEY UPDATE `date_updated_gmt` = VALUES( `date_updated_gmt` ), `id` = VALUES( `id` ), `status` = VALUES( `status` ), `type` = VALUES( `type` )
</p>
<p>Queries made or created this session were:</p>
<ol>
<li>Executing: BEGIN | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_table_info(:table_name) as l WHERE l.pk &gt; 0; | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_index_list(&quot;wp_wc_orders&quot;) as l; | (no parameters)</li>
<li>Executing: 
INSERT INTO wp_wc_orders ( `date_updated_gmt`, `id`, `status`, `type` )
VALUES ( :param0 , 16, :param1 , :param2  )
ON   CONFLICT (&quot;id&quot;, ) DO UPDATE SET  `date_updated_gmt` = excluded. `date_updated_gmt` , `id` = excluded. `id` , `status` = excluded. `status` , `type` = excluded. `type` 
 | parameters: 2024-05-17 09:58:06, wc-pending, shop_order</li>
<li>Executing: ROLLBACK | (no parameters)</li>
</ol>
</div>
<div style="clear:both;margin-bottom:2px;border:red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;">
Error occurred at line 3776 in Function <code>handle_error</code>. Error message was: SQLSTATE[HY000]: General error: 1 near ")": syntax error.
</div>
<p>Backtrace:</p>
<pre>#0 /wordpress/wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(287): WP_SQLite_Translator->get_error_message()
#1 /wordpress/wp-content/plugins/woocommerce/src/Internal/Utilities/DatabaseUtil.php(268): WP_SQLite_DB->query('\nINSERT INTO wp...')
#2 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(1859): Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update('wp_wc_orders', Array, Array)
#3 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2638): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db(Object(WC_Order))
#4 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2576): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_updates(Object(WC_Order))
#5 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(196): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->update(Object(WC_Order))
#6 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(212): WC_Data_Store->update(Object(WC_Order))
#7 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-order.php(252): WC_Abstract_Order->save()
#8 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-order.php(365): WC_Order->save()
#9 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/CheckoutTrait.php(45): WC_Order->update_status('pending')
#10 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(254): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->process_without_payment(Object(WP_REST_Request), Object(Automattic\WooCommerce\StoreApi\Payments\PaymentResult))
#11 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/AbstractRoute.php(121): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response(Object(WP_REST_Request))
#12 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(125): Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method(Object(WP_REST_Request))
#13 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response(Object(WP_REST_Request))
#14 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wc/store/v1/ch...', Array, NULL)
#15 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->dispatch(Object(WP_REST_Request))
#16 /wordpress/wp-includes/rest-api.php(2): WP_REST_Server->serve_request('/wc/store/v1/ch...')
#17 /wordpress/wp-includes/class-wp-hook.php(3): rest_api_loaded(Object(WP))
#18 /wordpress/wp-includes/class-wp-hook.php(3): WP_Hook->apply_filters(NULL, Array)
#19 /wordpress/wp-includes/plugin.php(2): WP_Hook->do_action(Array)
#20 /wordpress/wp-includes/class-wp.php(3): do_action_ref_array('parse_request', Array)
#21 /wordpress/wp-includes/class-wp.php(3): WP->parse_request('')
#22 /wordpress/wp-includes/functions.php(2): WP->main('')
#23 /wordpress/wp-blog-header.php(2): wp()
#24 /wordpress/index.php(2): require('/wordpress/wp-b...')
#25 {main}</pre>
 for query 
INSERT INTO wp_wc_orders ( `date_updated_gmt`, `id`, `status`, `type` )
VALUES ( '2024-05-17 09:58:06', 16, 'wc-pending', 'shop_order' )
ON DUPLICATE KEY UPDATE `date_updated_gmt` = VALUES( `date_updated_gmt` ), `id` = VALUES( `id` ), `status` = VALUES( `status` ), `type` = VALUES( `type` )
 made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response, Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->process_without_payment, WC_Order->update_status, WC_Order->save, WC_Abstract_Order->save, WC_Data_Store->update, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->update, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_updates, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db, Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update, WP_SQLite_DB->query, WP_SQLite_DB->print_error
[17-May-2024 09:58:06 UTC] WordPress database error <div style="clear:both">&nbsp;</div>
<div class="queries" style="clear:both;margin-bottom:2px;border:red dotted thin;">
<p>MySQL query:</p>
<p>
INSERT INTO wp_wc_orders ( `date_updated_gmt`, `id`, `status`, `type` )
VALUES ( '2024-05-17 09:58:06', 16, 'wc-processing', 'shop_order' )
ON DUPLICATE KEY UPDATE `date_updated_gmt` = VALUES( `date_updated_gmt` ), `id` = VALUES( `id` ), `status` = VALUES( `status` ), `type` = VALUES( `type` )
</p>
<p>Queries made or created this session were:</p>
<ol>
<li>Executing: BEGIN | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_table_info(:table_name) as l WHERE l.pk &gt; 0; | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_index_list(&quot;wp_wc_orders&quot;) as l; | (no parameters)</li>
<li>Executing: 
INSERT INTO wp_wc_orders ( `date_updated_gmt`, `id`, `status`, `type` )
VALUES ( :param0 , 16, :param1 , :param2  )
ON   CONFLICT (&quot;id&quot;, ) DO UPDATE SET  `date_updated_gmt` = excluded. `date_updated_gmt` , `id` = excluded. `id` , `status` = excluded. `status` , `type` = excluded. `type` 
 | parameters: 2024-05-17 09:58:06, wc-processing, shop_order</li>
<li>Executing: ROLLBACK | (no parameters)</li>
</ol>
</div>
<div style="clear:both;margin-bottom:2px;border:red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;">
Error occurred at line 3776 in Function <code>handle_error</code>. Error message was: SQLSTATE[HY000]: General error: 1 near ")": syntax error.
</div>
<p>Backtrace:</p>
<pre>#0 /wordpress/wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(287): WP_SQLite_Translator->get_error_message()
#1 /wordpress/wp-content/plugins/woocommerce/src/Internal/Utilities/DatabaseUtil.php(268): WP_SQLite_DB->query('\nINSERT INTO wp...')
#2 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(1859): Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update('wp_wc_orders', Array, Array)
#3 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2638): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db(Object(WC_Order))
#4 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2576): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_updates(Object(WC_Order))
#5 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(196): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->update(Object(WC_Order))
#6 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(212): WC_Data_Store->update(Object(WC_Order))
#7 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-order.php(252): WC_Abstract_Order->save()
#8 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-order.php(151): WC_Order->save()
#9 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/CheckoutTrait.php(46): WC_Order->payment_complete()
#10 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(254): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->process_without_payment(Object(WP_REST_Request), Object(Automattic\WooCommerce\StoreApi\Payments\PaymentResult))
#11 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/AbstractRoute.php(121): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response(Object(WP_REST_Request))
#12 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(125): Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method(Object(WP_REST_Request))
#13 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response(Object(WP_REST_Request))
#14 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wc/store/v1/ch...', Array, NULL)
#15 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->dispatch(Object(WP_REST_Request))
#16 /wordpress/wp-includes/rest-api.php(2): WP_REST_Server->serve_request('/wc/store/v1/ch...')
#17 /wordpress/wp-includes/class-wp-hook.php(3): rest_api_loaded(Object(WP))
#18 /wordpress/wp-includes/class-wp-hook.php(3): WP_Hook->apply_filters(NULL, Array)
#19 /wordpress/wp-includes/plugin.php(2): WP_Hook->do_action(Array)
#20 /wordpress/wp-includes/class-wp.php(3): do_action_ref_array('parse_request', Array)
#21 /wordpress/wp-includes/class-wp.php(3): WP->parse_request('')
#22 /wordpress/wp-includes/functions.php(2): WP->main('')
#23 /wordpress/wp-blog-header.php(2): wp()
#24 /wordpress/index.php(2): require('/wordpress/wp-b...')
#25 {main}</pre>
 for query 
INSERT INTO wp_wc_orders ( `date_updated_gmt`, `id`, `status`, `type` )
VALUES ( '2024-05-17 09:58:06', 16, 'wc-processing', 'shop_order' )
ON DUPLICATE KEY UPDATE `date_updated_gmt` = VALUES( `date_updated_gmt` ), `id` = VALUES( `id` ), `status` = VALUES( `status` ), `type` = VALUES( `type` )
 made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response, Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->process_without_payment, WC_Order->payment_complete, WC_Order->save, WC_Abstract_Order->save, WC_Data_Store->update, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->update, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_updates, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db, Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update, WP_SQLite_DB->query, WP_SQLite_DB->print_error
[17-May-2024 09:58:06 UTC] WordPress database error <div style="clear:both">&nbsp;</div>
<div class="queries" style="clear:both;margin-bottom:2px;border:red dotted thin;">
<p>MySQL query:</p>
<p>
INSERT INTO wp_wc_order_operational_data ( `date_paid_gmt`, `order_id` )
VALUES ( '2024-05-17 09:58:06', 16 )
ON DUPLICATE KEY UPDATE `date_paid_gmt` = VALUES( `date_paid_gmt` ), `order_id` = VALUES( `order_id` )
</p>
<p>Queries made or created this session were:</p>
<ol>
<li>Executing: BEGIN | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_table_info(:table_name) as l WHERE l.pk &gt; 0; | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_index_list(&quot;wp_wc_order_operational_data&quot;) as l; | (no parameters)</li>
<li>Executing: SELECT * FROM pragma_index_info(&quot;wp_wc_order_operational_data__order_id&quot;) as l; | (no parameters)</li>
<li>Executing: 
INSERT INTO wp_wc_order_operational_data ( `date_paid_gmt`, `order_id` )
VALUES ( :param0 , 16 )
ON   CONFLICT (&quot;order_id&quot;, ) DO UPDATE SET  `date_paid_gmt` = excluded. `date_paid_gmt` , `order_id` = excluded. `order_id` 
 | parameters: 2024-05-17 09:58:06</li>
<li>Executing: ROLLBACK | (no parameters)</li>
</ol>
</div>
<div style="clear:both;margin-bottom:2px;border:red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;">
Error occurred at line 3776 in Function <code>handle_error</code>. Error message was: SQLSTATE[HY000]: General error: 1 near ")": syntax error.
</div>
<p>Backtrace:</p>
<pre>#0 /wordpress/wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php(287): WP_SQLite_Translator->get_error_message()
#1 /wordpress/wp-content/plugins/woocommerce/src/Internal/Utilities/DatabaseUtil.php(268): WP_SQLite_DB->query('\nINSERT INTO wp...')
#2 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(1859): Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update('wp_wc_order_ope...', Array, Array)
#3 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2638): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db(Object(WC_Order))
#4 /wordpress/wp-content/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php(2576): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_updates(Object(WC_Order))
#5 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(196): Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->update(Object(WC_Order))
#6 /wordpress/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(212): WC_Data_Store->update(Object(WC_Order))
#7 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-order.php(252): WC_Abstract_Order->save()
#8 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-order.php(151): WC_Order->save()
#9 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/CheckoutTrait.php(46): WC_Order->payment_complete()
#10 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(254): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->process_without_payment(Object(WP_REST_Request), Object(Automattic\WooCommerce\StoreApi\Payments\PaymentResult))
#11 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/AbstractRoute.php(121): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response(Object(WP_REST_Request))
#12 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(125): Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method(Object(WP_REST_Request))
#13 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response(Object(WP_REST_Request))
#14 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wc/store/v1/ch...', Array, NULL)
#15 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->dispatch(Object(WP_REST_Request))
#16 /wordpress/wp-includes/rest-api.php(2): WP_REST_Server->serve_request('/wc/store/v1/ch...')
#17 /wordpress/wp-includes/class-wp-hook.php(3): rest_api_loaded(Object(WP))
#18 /wordpress/wp-includes/class-wp-hook.php(3): WP_Hook->apply_filters(NULL, Array)
#19 /wordpress/wp-includes/plugin.php(2): WP_Hook->do_action(Array)
#20 /wordpress/wp-includes/class-wp.php(3): do_action_ref_array('parse_request', Array)
#21 /wordpress/wp-includes/class-wp.php(3): WP->parse_request('')
#22 /wordpress/wp-includes/functions.php(2): WP->main('')
#23 /wordpress/wp-blog-header.php(2): wp()
#24 /wordpress/index.php(2): require('/wordpress/wp-b...')
#25 {main}</pre>
 for query 
INSERT INTO wp_wc_order_operational_data ( `date_paid_gmt`, `order_id` )
VALUES ( '2024-05-17 09:58:06', 16 )
ON DUPLICATE KEY UPDATE `date_paid_gmt` = VALUES( `date_paid_gmt` ), `order_id` = VALUES( `order_id` )
 made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response, Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response, Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->process_without_payment, WC_Order->payment_complete, WC_Order->save, WC_Abstract_Order->save, WC_Data_Store->update, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->update, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_updates, Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore->persist_order_to_db, Automattic\WooCommerce\Internal\Utilities\DatabaseUtil->insert_on_duplicate_key_update, WP_SQLite_DB->query, WP_SQLite_DB->print_error
[17-May-2024 09:58:06 UTC] PHP Fatal error:  Uncaught Error: Call to a member function get_payment_method() on false in /wordpress/wp-content/plugins/woocommerce/includes/gateways/paypal/class-wc-gateway-paypal.php:448
Stack trace:
#0 /wordpress/wp-includes/class-wp-hook.php(3): WC_Gateway_Paypal->capture_payment(16)
#1 /wordpress/wp-includes/class-wp-hook.php(3): WP_Hook->apply_filters(NULL, Array)
#2 /wordpress/wp-includes/plugin.php(2): WP_Hook->do_action(Array)
#3 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-order.php(411): do_action('woocommerce_ord...', 16, Object(WC_Order), Array)
#4 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-order.php(253): WC_Order->status_transition()
#5 /wordpress/wp-content/plugins/woocommerce/includes/class-wc-order.php(151): WC_Order->save()
#6 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Utilities/CheckoutTrait.php(46): WC_Order->payment_complete()
#7 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(254): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->process_without_payment(Object(WP_REST_Request), Object(Automattic\WooCommerce\StoreApi\Payments\PaymentResult))
#8 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/AbstractRoute.php(121): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_route_post_response(Object(WP_REST_Request))
#9 /wordpress/wp-content/plugins/woocommerce/src/StoreApi/Routes/V1/Checkout.php(125): Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute->get_response_by_request_method(Object(WP_REST_Request))
#10 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): Automattic\WooCommerce\StoreApi\Routes\V1\Checkout->get_response(Object(WP_REST_Request))
#11 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wc/store/v1/ch...', Array, NULL)
#12 /wordpress/wp-includes/rest-api/class-wp-rest-server.php(3): WP_REST_Server->dispatch(Object(WP_REST_Request))
#13 /wordpress/wp-includes/rest-api.php(2): WP_REST_Server->serve_request('/wc/store/v1/ch...')
#14 /wordpress/wp-includes/class-wp-hook.php(3): rest_api_loaded(Object(WP))
#15 /wordpress/wp-includes/class-wp-hook.php(3): WP_Hook->apply_filters(NULL, Array)
#16 /wordpress/wp-includes/plugin.php(2): WP_Hook->do_action(Array)
#17 /wordpress/wp-includes/class-wp.php(3): do_action_ref_array('parse_request', Array)
#18 /wordpress/wp-includes/class-wp.php(3): WP->parse_request('')
#19 /wordpress/wp-includes/functions.php(2): WP->main('')
#20 /wordpress/wp-blog-header.php(2): wp()
#21 /wordpress/index.php(2): require('/wordpress/wp-b...')
#22 {main}
  thrown in /wordpress/wp-content/plugins/woocommerce/includes/gateways/paypal/class-wc-gateway-paypal.php on line 448

@bgrgicak
Copy link
Collaborator

This looks like it could be related to the ON DUPLICATE KEY rewrite.
This is how it looks after rewriting

INSERT INTO wp_wc_order_operational_data ( `discount_tax_amount`, `discount_total_amount`, `order_id` ) VALUES ( 0.000000, 0.000000, 16 ) ON CONFLICT (&quot;order_id&quot;, ) DO UPDATE SET `discount_tax_amount` = excluded. `discount_tax_amount` , `discount_total_amount` = excluded. `discount_total_amount` , `order_id` = excluded. `order_id`

ON CONFLICT (&quot;order_id&quot;, ) looks broken. there is an extra , at the end and I'm not sure if the quotes are also part of the problem.

I will add a few tests to the SQLite integration plugin to see how it looks there.

@bgrgicak
Copy link
Collaborator

This if is adding the extra , and it's causing the issue.

It can be tested using this test

public function testOnDuplicateKey() {
		$this->assertQuery("
			CREATE TABLE `wp_wc_orders` (
				`id` INT PRIMARY KEY,
				`billing_email` VARCHAR(255),
				`currency` VARCHAR(255),
				`customer_id` INT,
				`customer_note` TEXT,
				`date_created_gmt` DATETIME,
				`date_updated_gmt` DATETIME,
				`ip_address` VARCHAR(255),
				`parent_order_id` INT,
				`payment_method` VARCHAR(255),
				`payment_method_title` VARCHAR(255),
				`status` VARCHAR(255),
				`tax_amount` DECIMAL(10, 6),
				`total_amount` DECIMAL(10, 6),
				`transaction_id` VARCHAR(255),
				`type` VARCHAR(255),
				`user_agent` VARCHAR(255)
			);
		");
		$this->assertQuery( "INSERT INTO wp_wc_orders ( `billing_email`, `currency`, `customer_id`, `customer_note`, `date_created_gmt`, `date_updated_gmt`, `id`, `ip_address`, `parent_order_id`, `payment_method`, `payment_method_title`, `status`, `tax_amount`, `total_amount`, `transaction_id`, `type`, `user_agent` )
			VALUES ( 'admin@localhost.com', 'ALL', 1, '', '2024-05-17 09:58:06', '2024-05-17 09:58:06', 16, '127.0.0.1', 0, '', '', 'wc-checkout-draft', 0.000000, 0.000000, '', 'shop_order', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36' )
			ON DUPLICATE KEY UPDATE `billing_email` = VALUES( `billing_email` ), `currency` = VALUES( `currency` ), `customer_id` = VALUES( `customer_id` ), `customer_note` = VALUES( `customer_note` ), `date_created_gmt` = VALUES( `date_created_gmt` ), `date_updated_gmt` = VALUES( `date_updated_gmt` ), `id` = VALUES( `id` ), `ip_address` = VALUES( `ip_address` ), `parent_order_id` = VALUES( `parent_order_id` ), `payment_method` = VALUES( `payment_method` ), `payment_method_title` = VALUES( `payment_method_title` ), `status` = VALUES( `status` ), `tax_amount` = VALUES( `tax_amount` ), `total_amount` = VALUES( `total_amount` ), `transaction_id` = VALUES( `transaction_id` ), `type` = VALUES( `type` ), `user_agent` = VALUES( `user_agent` )"
		);

	}

@bgrgicak
Copy link
Collaborator

The root cause of the issue is that the id (key) isn't in the first position.

This test will fail, but if the the insert is updated to id, text it will work.

public function testOnDuplicateKey() {
		$this->assertQuery("
			CREATE TABLE `test` (
				`id` INT PRIMARY KEY,
				`text` VARCHAR(255),
			);
		");
		$this->assertQuery( "INSERT INTO test (`text`, `id`)
			VALUES ('test', 1)
			ON DUPLICATE KEY UPDATE `text` = 'test1'"
		);
	}

adamziel pushed a commit to WordPress/sqlite-database-integration that referenced this issue May 17, 2024
…sition (#113)

[WordPress Playground observed an
issu](WordPress/wordpress-playground#731
with insert queries that use `ON DUPLICATE KEY` and don't have the KEY
as the first value of the insert.

After investigating it it turns out that the condition for adding commas
didn't work well in case the KEY value is in a "random" place.

This PR ensures the comma is added for all items except for the last
one.

## Testing instructions

- Ensure tests pass
@bgrgicak
Copy link
Collaborator

Orders can now be placed using HPOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Aspect] Sqlite [Type] Bug An existing feature does not function as intended
Projects
Archived in project
Development

No branches or pull requests

2 participants