You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT work_share_round_ref.field_share_round_nid AS `round_nid`,
work_share_submitter.field_share_submitter_uid AS `user_uid`,
MIN(work_share_difficulty.field_share_difficulty_value) AS `user_round_min_difficulty`,
COUNT(1) AS `user_round_share_count`
FROM node AS `node_work_share`
JOIN field_data_field_share_round AS `work_share_round_ref`
ON node_work_share.nid = work_share_round_ref.entity_id
AND work_share_round_ref.entity_type = 'node'
AND work_share_round_ref.deleted = 0
JOIN field_data_field_share_difficulty AS `work_share_difficulty`
ON node_work_share.nid = work_share_difficulty.entity_id
AND work_share_difficulty.entity_type = 'node'
AND work_share_difficulty.deleted = 0
JOIN field_data_field_share_submitter AS `work_share_submitter`
ON node_work_share.nid = work_share_submitter.entity_id
AND work_share_difficulty.entity_type = 'node'
AND work_share_difficulty.deleted = 0
JOIN field_data_field_share_verified_by_pool AS `work_share_verified`
ON node_work_share.nid = work_share_verified.entity_id
AND work_share_difficulty.entity_type = 'node'
AND work_share_difficulty.deleted = 0
WHERE node_work_share.type = 'share'
AND node_work_share.status = 1
AND work_share_verified.field_share_verified_by_pool_value = 1
GROUP BY round_nid, user_uid
This resulted in the following output from convert:
CALL flexviews.create('theredpool_drupal', '', 'INCREMENTAL');
SET @mvid := LAST_INSERT_ID();
CALL flexviews.add_expr(@mvid,'GROUP','work_share_round_ref.field_share_round_nid','round_nid');
CALL flexviews.add_expr(@mvid,'GROUP','work_share_submitter.field_share_submitter_uid','user_uid');
CALL flexviews.add_expr(@mvid,'MIN','work_share_difficulty.field_share_difficulty_value','user_round_min_difficulty');
CALL flexviews.add_expr(@mvid,'COUNT','1','user_round_share_count');
CALL flexviews.add_table(@mvid,'theredpool_drupal','node','node_work_share',NULL);
CALL flexviews.add_table(@mvid,'theredpool_drupal','field_data_field_share_round','work_share_round_ref','ON node_work_share.nid = work_share_round_ref.entity_id AND work_share_round_ref.entity_type = \'\'node\'\' AND work_share_round_ref.deleted = 0');
CALL flexviews.add_table(@mvid,'theredpool_drupal','field_data_field_share_difficulty','work_share_difficulty','ON node_work_share.nid = work_share_difficulty.entity_id AND work_share_difficulty.entity_type = \'\'node\'\' AND work_share_difficulty.deleted = 0');
CALL flexviews.add_table(@mvid,'theredpool_drupal','field_data_field_share_submitter','work_share_submitter','ON node_work_share.nid = work_share_submitter.entity_id AND work_share_difficulty.entity_type = \'\'node\'\' AND work_share_difficulty.deleted = 0');
CALL flexviews.add_table(@mvid,'theredpool_drupal','field_data_field_share_verified_by_pool','work_share_verified','ON node_work_share.nid = work_share_verified.entity_id AND work_share_difficulty.entity_type = \'\'node\'\' AND work_share_difficulty.deleted = 0');
CALL flexviews.add_expr(@mvid,'WHERE','node_work_share.type = \'\' \'\' AND node_work_share.status = 1 AND work_share_verified.field_share_verified_by_pool_value = 1','where_clause');
CALL flexviews.enable(@mvid);
Three issues:
Why does the convert script not take an MV name parameter on the command line? I always forget to fill in the name on the first line of the output.
Each single-quoted string is over-quoted (i.e. ' turns into '' instead of ').
The first single-quoted string in the WHERE clause is completely dropped.
If I change to double-quoted strings, 2 and 3 are no longer issues.
The text was updated successfully, but these errors were encountered:
This was the input query:
This resulted in the following output from convert:
Three issues:
If I change to double-quoted strings, 2 and 3 are no longer issues.
The text was updated successfully, but these errors were encountered: