У меня есть .vmb файл. С помощью уилиты Mysql WorkBanch я хочу создать новую БД. При выполнении скрипта получаю ошибку
Executing SQL script in server
ERROR: Error 1146: Table 'smap_production.weights_elements_c' doesn't exist
SQL script execution finished: statements: 129 succeeded, 1 failed
Fetching back view definitions in final form.
Could not get definition for smap_production.sum_e_weight_by_c from server
Could not get definition for smap_production.norm_e_weights from server
Could not get definition for smap_production.check_c_weights_100 from server
Could not get definition for smap_production.check_norm_weights_100 from server
Could not get definition for smap_production.vp_scores from server
Could not get definition for smap_production.check_missing_price_scores from server
Could not get definition for smap_production.sum_vp_scores from server
Could not get definition for smap_production.sm_scores_partic_1 from server
Could not get definition for smap_production.sm_scores from server
Could not get definition for smap_production.ms_sm_scores from server
10 views were read back.
Кусок sql скрипта выглядит так
-- View `smap_production`.`sum_e_weight_by_c`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `smap_production`.`sum_e_weight_by_c` ;
DROP TABLE IF EXISTS `smap_production`.`sum_e_weight_by_c`;
USE `smap_production`;
CREATE OR REPLACE VIEW sum_e_weight_by_c AS
SELECT t1.m_id, t1.persona_id, t1.c_id, t1.sum_e_weight_by_c, weights_categories_c.c_weight
FROM (
SELECT weights_elements_c.m_id, weights_elements_c.persona_id, weights_categories_c.c_id, SUM(e_weight) as sum_e_weight_by_c
FROM weights_elements_c
LEFT JOIN elements_c on weights_elements_c.e_id = elements_c.eid
LEFT JOIN subcategories_c on elements_c.s_id = subcategories_c.sid
LEFT JOIN weights_categories_c ON weights_elements_c.m_id = weights_categories_c.m_id AND weights_elements_c.persona_id = weights_categories_c.persona_id AND subcategories_c.c_id = weights_categories_c.c_id
GROUP BY weights_elements_c.m_id, weights_elements_c.persona_id, weights_categories_c.c_id
) t1
LEFT JOIN weights_categories_c ON t1.m_id = weights_categories_c.m_id AND t1.persona_id = weights_categories_c.persona_id AND t1.c_id = weights_categories_c.c_id;
При этом сразу за ним идет похожий код
-- -----------------------------------------------------
-- View `smap_production`.`norm_e_weights`
-- -----------------------------------------------------
DROP VIEW IF EXISTS `smap_production`.`norm_e_weights` ;
DROP TABLE IF EXISTS `smap_production`.`norm_e_weights`;
USE `smap_production`;
-- There are a few NULLvalues, which are the ones that are dividing by 0, should be okay being NULL
CREATE OR REPLACE VIEW norm_e_weights AS
SELECT weights_elements_c.m_id, weights_elements_c.persona_id, weights_elements_c.e_id,
sum_e_weight_by_c.c_id, sum_e_weight_by_c.sum_e_weight_by_c, sum_e_weight_by_c.c_weight,
e_weight/sum_e_weight_by_c*c_weight as norm_weight
FROM weights_elements_c
LEFT JOIN elements_c on weights_elements_c.e_id = elements_c.eid
LEFT JOIN subcategories_c on elements_c.s_id = subcategories_c.sid
LEFT JOIN sum_e_weight_by_c ON weights_elements_c.m_id = sum_e_weight_by_c.m_id AND weights_elements_c.persona_id = sum_e_weight_by_c.persona_id AND subcategories_c.c_id = sum_e_weight_by_c.c_id;
В котором тоже идет обращение к
weights_elements_c но ошибки он не вызывает
опыта у меня с mysql минимально.
1.Подскажите как отдебажить ошибку
2. я вижу что база данных создается и таблицы в ней тоже. Эта ошибка не влияет на создание базы?
3. что означает информация в конце лога выполнения скрипта
Could not get definition for .....