Fix (MySQL): Update for MariaDB v10.3 to match ERPNext installation on Oracle VPS.
This commit is contained in:
@@ -24,7 +24,7 @@ BEGIN
|
||||
DECLARE v_id_permission INT;
|
||||
-- DECLARE v_ids_product VARCHAR(500);
|
||||
DECLARE v_id_access_level_view INT;
|
||||
# DECLARE v_id_access_level_product_required INT;
|
||||
-- DECLARE v_id_access_level_product_required INT;
|
||||
DECLARE v_priority_access_level_view INT;
|
||||
DECLARE v_priority_access_level_edit INT;
|
||||
DECLARE v_priority_access_level_admin INT;
|
||||
@@ -137,7 +137,7 @@ BEGIN
|
||||
;
|
||||
END IF;
|
||||
|
||||
# Access levels
|
||||
-- Access levels
|
||||
IF v_has_filter_access_level THEN
|
||||
CALL partsltd_prod.p_split(a_guid, a_ids_access_level, ',', a_debug);
|
||||
|
||||
@@ -157,7 +157,7 @@ BEGIN
|
||||
|
||||
CALL partsltd_prod.p_clear_split_temp( a_guid );
|
||||
|
||||
# Invalid IDs
|
||||
-- Invalid IDs
|
||||
IF EXISTS (
|
||||
SELECT t_S.substring
|
||||
FROM tmp_Split t_S
|
||||
@@ -224,7 +224,7 @@ BEGIN
|
||||
|
||||
CALL partsltd_prod.p_clear_split_temp( a_guid );
|
||||
|
||||
# Invalid or inactive
|
||||
-- Invalid or inactive
|
||||
IF EXISTS (SELECT PERM.id_permission FROM tmp_Split t_S LEFT JOIN partsltd_prod.Shop_Permission PERM ON t_S.as_int = PERM.id_permission WHERE ISNULL(t_S.as_int) OR ISNULL(PERM.id_permission) OR PERM.active = 0) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
-- guid,
|
||||
@@ -256,7 +256,7 @@ BEGIN
|
||||
END IF;
|
||||
DELETE FROM tmp_Split;
|
||||
|
||||
# Users
|
||||
-- Users
|
||||
CALL partsltd_prod.p_split(a_guid, a_ids_user, ',', a_debug);
|
||||
|
||||
INSERT INTO tmp_Split (
|
||||
@@ -275,7 +275,7 @@ BEGIN
|
||||
|
||||
CALL partsltd_prod.p_clear_split_temp( a_guid );
|
||||
|
||||
# Invalid or inactive
|
||||
-- Invalid or inactive
|
||||
IF EXISTS (SELECT U.id_user FROM tmp_Split t_S LEFT JOIN partsltd_prod.Shop_User U ON t_S.as_int = U.id_user WHERE ISNULL(t_S.as_int) OR ISNULL(U.id_user) OR (a_get_inactive_user = 0 AND U.active = 0)) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
-- guid,
|
||||
@@ -399,11 +399,11 @@ BEGIN
|
||||
;
|
||||
*/
|
||||
|
||||
# SET v_has_filter_user = EXISTS ( SELECT * FROM tmp_User_Calc_User LIMIT 1 );
|
||||
-- SET v_has_filter_user = EXISTS ( SELECT * FROM tmp_User_Calc_User LIMIT 1 );
|
||||
END IF;
|
||||
DELETE FROM tmp_Split;
|
||||
|
||||
# Products
|
||||
-- Products
|
||||
IF v_has_filter_product = 1 THEN
|
||||
CALL partsltd_prod.p_split(a_guid, a_ids_product, ',', a_debug);
|
||||
|
||||
@@ -423,7 +423,7 @@ BEGIN
|
||||
|
||||
CALL partsltd_prod.p_clear_split_temp( a_guid );
|
||||
|
||||
# Invalid product IDs
|
||||
-- Invalid product IDs
|
||||
IF EXISTS (SELECT * FROM tmp_Split t_S LEFT JOIN partsltd_prod.Shop_Product P ON t_S.as_int = P.id_product WHERE ISNULL(t_S.as_int) OR ISNULL(P.id_product)) THEN
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
-- guid,
|
||||
@@ -457,7 +457,7 @@ BEGIN
|
||||
CASE WHEN AL_P.priority < AL_C.priority THEN AL_P.id_access_level ELSE AL_C.id_access_level END AS id_access_level_required,
|
||||
CASE WHEN AL_P.priority < AL_C.priority THEN AL_P.priority ELSE AL_C.priority END AS priority_access_level_required
|
||||
FROM tmp_Split t_S
|
||||
INNER JOIN partsltd_prod.Shop_Product P ON t_S.as_int = P.id_product # Shop_Product_Permutation PP
|
||||
INNER JOIN partsltd_prod.Shop_Product P ON t_S.as_int = P.id_product -- Shop_Product_Permutation PP
|
||||
INNER JOIN partsltd_prod.Shop_Access_Level AL_P
|
||||
ON P.id_access_level_required = AL_P.id_access_level
|
||||
AND AL_P.active
|
||||
@@ -566,7 +566,7 @@ BEGIN
|
||||
DROP TABLE IF EXISTS tmp_Calc_User;
|
||||
DROP TABLE IF EXISTS tmp_User_Calc_User;
|
||||
DROP TABLE IF EXISTS tmp_Product_Calc_User;
|
||||
# Don't destroy common tables in nested Stored Procedures!
|
||||
-- Don't destroy common tables in nested Stored Procedures!
|
||||
-- DROP TABLE IF EXISTS tmp_Split;
|
||||
DELETE FROM tmp_Split;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user