Commit Graph

246 Commits

Author SHA1 Message Date
Peter Fabian 9f0fb0b404 Foxed the use to correct stock quantity parameter. 2019-05-15 16:18:24 +02:00
Peter Fabian af7950910c Removed the transaction and locking code.
NOWAIT is not supported on MySQL server 5.5,

SELECT ... FOR UPDATE can leave lingering locks on InnoDB ("When InnoDB performs a complete rollback of a transaction, all locks set by the transaction are released. However, if just a single SQL statement is rolled back as a result of an error, some of the locks set by the statement may be preserved. This happens because InnoDB stores row locks in a format such that it cannot know afterward which lock was set by which statement.", via https://dev.mysql.com/doc/refman/5.5/en/innodb-deadlock-detection.html)
2019-05-15 15:09:16 +02:00
Peter Fabian 68a325249f Removed the extra parameter that didn't make sense.
Also get_data_for_lookup_table should not be checking db value of  _manage_stock as that can be in the process of being changed.
2019-05-15 14:20:27 +02:00
Peter Fabian 375880e06b Made the increase and decrease operations atomic, set is atomic as it's not fetch-and-update, just update. 2019-05-02 19:41:15 +02:00
Peter Fabian 44f1803c53 Tweaked update lookup table to add the possibility to ignore manage_stock value from the database.
E.g. if manage_stock property has been changed in the object/local copy of the product while updating it, but the product has not been saved to the db yet, the lookup table update would ignore stock quantity update.
2019-05-02 19:29:28 +02:00
Mike Jolley 0cd5c1da66 Allow stock to be force read without a change 2019-04-26 17:24:11 +01:00
Mike Jolley ae7436d37c Select for update, returning the new stock value 2019-04-26 17:23:45 +01:00
Mike Jolley f306d3fc11
Merge pull request #23266 from woocommerce/fix/23234
Switch to subquery for sale product query
2019-04-18 12:36:22 +01:00
Timmy Crawford e12e4aaa25
Merge pull request #23304 from woocommerce/fix/link-all-variations
[3.6] Fix logic in link all variations
2019-04-15 11:16:22 -07:00
Mike Jolley 30129f00ff Fix issue in tests by disabling strict mode 2019-04-15 12:10:22 +01:00
Mike Jolley d0c6c54989 Moved link/create code to data store with new unit test
This code was not testable within ajax code, so moved to the data stores.
2019-04-15 11:59:57 +01:00
Mike Jolley fe385c9f74 fix query by adding alias 2019-04-10 13:48:03 +01:00
Mike Jolley 2e24cc7b0c Switch to subquery for sale product query 2019-04-10 12:43:22 +01:00
Manos Psychogyiopoulos 861d42f368 Fix IN type 2019-04-09 05:48:08 +03:00
Manos Psychogyiopoulos f6c560d684 Introduce IN and NOT IN clauses in `WC_Product_Data_Store_CPT::search_products`
closes #23245
2019-04-09 05:33:50 +03:00
Timmy Crawford e1c09b4609
Merge pull request #22973 from woocommerce/update/22545
Revised sale start/end date save logic
2019-03-14 17:53:40 -07:00
Mike Jolley 8d0ec76cea Update the table on save 2019-03-13 17:33:44 +00:00
Mike Jolley 53896e3149 onsale lookup 2019-03-13 17:14:20 +00:00
Mike Jolley 16ff51ded3 Use lookup table ID 2019-03-13 15:00:12 +00:00
Mike Jolley d17dc119bc SKU lookup 2019-03-13 13:30:49 +00:00
Mike Jolley df0c432de2 update_product_stock should sync lookup table 2019-03-13 13:30:31 +00:00
Mike Jolley f6d9e7796f is_existing_sku use lookup 2019-03-13 13:25:55 +00:00
Mike Jolley e55bb84e8b
Merge pull request #22718 from woocommerce/experiment/product-sorting-index
Performance: product sorting lookup table
2019-03-11 13:27:10 +00:00
Mike Jolley c56d3ede9f Remove day offsets 2019-03-08 13:35:30 +00:00
Mike Jolley 15ca2144d3
Merge pull request #22773 from woocommerce/performance/delete-empty-meta
Performance: delete empty meta
2019-03-08 10:22:31 +00:00
Mike Jolley 663f724bdd Cleanup methods 2019-03-07 15:08:22 +00:00
Mike Jolley dc635b9561 Update search_products to use lookup table 2019-03-07 14:46:01 +00:00
Mike Jolley 0782d39a55 Stock status 2019-03-07 14:32:20 +00:00
Mike Jolley 1ab455ec09 virtual and downloadable 2019-03-07 14:07:51 +00:00
Mike Jolley dfc539c051 SKU column 2019-03-07 13:34:28 +00:00
Mike Jolley a697c97472 Add rating_count to lookup table 2019-03-06 14:03:44 +00:00
Gerhard e36ffaa6f0 Use correct meta key _stock for updating lookup table stock. 2019-03-05 14:38:22 +02:00
Mike Jolley 5af9d968e5 Update from master 2019-03-01 10:29:17 +00:00
Mike Jolley a2606a3f1f Avoid updates on read - this is for legacy where meta was missing and shouldn't be ran for all products 2019-02-28 14:47:06 +00:00
Mike Jolley c6871bb107 Use update_or_delete_post_meta - exclude _tax_class which may be empty 2019-02-19 13:23:24 +00:00
Mike Jolley bdf77f5648
Merge pull request #22423 from woocommerce/performance/find-matching-variations
Performance - Finding matching variations
2019-02-19 09:53:34 +00:00
Claudio Sanches 8388325985 PHPCS ignore only what is necessary 2019-02-18 18:45:07 -03:00
Claudio Sanches 096e92554b Only disable WordPress.DB.SlowDBQuery.slow_db_query_tax_query 2019-02-18 18:42:11 -03:00
Claudio Sanches 88984da13a
Merge branch 'master' into performance/find-matching-variations 2019-02-18 18:41:17 -03:00
Claudio Sanches 4d5c6b9042 Use short cuts for wpdb properties 2019-02-18 18:38:29 -03:00
Mike Jolley 3d8c58e110 status_widget_stock_rows lookups 2019-02-15 13:37:51 +00:00
Mike Jolley 35d2161fa9 Stock lookup 2019-02-15 13:05:46 +00:00
Mike Jolley 3309276e82 Renamed table to wc_product_meta_lookup 2019-02-15 12:37:45 +00:00
Mike Jolley 2a0ba812a3 Check for decoded taxonomy name when unsetting 2019-02-14 15:58:12 +00:00
Mike Jolley fe853e5d02
Merge pull request #22672 from Chouby/update_stock_filter
Allow to filter the direct sql query to update the product stock
2019-02-13 14:32:43 +00:00
Mike Jolley 7f3816dfe7 Correct props to watch 2019-02-12 14:16:48 +00:00
Mike Jolley 64df8a2934 update lookup tables handlers and actions 2019-02-12 13:23:47 +00:00
Mike Jolley 2ebfe73524 Avoid updates on read - this is for legacy where meta was missing and shouldn't be ran for all products 2019-02-12 11:46:55 +00:00
Mike Jolley 1efe7747a8 merge conflict 2019-02-08 13:08:55 +00:00
Mike Jolley 889cf64ac4 Merge branch 'performance/wc-get-product-class' 2019-02-07 13:34:18 +00:00