Here are the steps I followed:
I installed & activated the modules (shadow & views)
Once I visited one of my views pages I noticed that it appeared on admin/build/shadow/queries
clicked on the newly appeared title of the view, thus going to admin/build/shadow/queries/list/2
selected create new table, selected a few tables there and when I finally applied the changes, this message appeared:

    Syntax error in definition: Parse error in state join_right_field at offset 33 (near *,content_).
    Syntax error in definition: Parse error in state join_right_field at offset 24 (near *,uc_produ).
    Syntax error in definition: Parse error in state join_right_field at offset 33 (near *,content_).

Needless to say, NO table was created in my database.
Any help? I really need this...

Comments

mauritsl’s picture

Status: Active » Postponed (maintainer needs more info)

I've made some improvements to the SQL parser, so please try again with the latest version. Can you provide the full query if you still get an error?

aristeides’s picture

Thanks a lot for looking into this!
Using latest dev, (uninstalled previous version first, then uploaded and activated the dev) I selected create a new table and after submiting I got an error The website encountered an unexpected error. Please try again later.

On the log:

Exception: Parse error in state "join" at offset 347 (near "(SELECT td") in ShadowStateMachine->parse() (line 141 of /home/siriocen/public_html/sites/all/modules/shadow/classes/state_machine.inc).

My query:

SELECT node.nid AS nid,
   node.vid AS node_vid,
   node.type AS node_type,
   term_data_node__term_image.tid AS term_data_node__term_image_tid,
   uc_products.sell_price AS uc_products_sell_price,
   node_data_field_offer.field_offer_value AS node_data_field_offer_field_offer_value,
   node.promote AS node_promote
 FROM {node} node 
 LEFT JOIN (SELECT td.*, tn.vid AS revision FROM {term_data} td INNER JOIN {term_node} tn ON tn.tid = td.tid WHERE td.vid IN (6)) term_data_node ON node.vid = term_data_node.revision
 INNER JOIN {term_node} term_node ON node.vid = term_node.vid
 LEFT JOIN {uc_products} uc_products ON node.vid = uc_products.vid
 LEFT JOIN {term_image} term_data_node__term_image ON term_data_node.tid = term_data_node__term_image.tid
 LEFT JOIN {content_type_product} node_data_field_offer ON node.vid = node_data_field_offer.vid
 WHERE (node.type in ('%s')) AND (term_node.tid = %d) AND (node.status = 1) AND (uc_products.sell_price > %f)
   ORDER BY node_promote DESC
mauritsl’s picture

Status: Postponed (maintainer needs more info) » Needs work

Hmm the "JOIN (subquery)" is very rare, didn't know yet that views used that syntax. Did you set it up with relations? It does not seem to be the reason why your query is slow anyway, just wondering...

I have to set borders to what Shadow can parse and what not. It cannot understand all possible SQL queries, but it has to in order to be able to rewrite them, but I will take a look if I can build in support for the "JOIN (subquery)" syntax.

Wolfgang Reszel’s picture

I've also problems with some queries, for example:

SELECT DISTINCT(node.nid) AS nid,
   term_data.name AS term_data_name,
   term_data.vid AS term_data_vid,
   term_data.tid AS term_data_tid,
   node.type AS node_type,
   node.vid AS node_vid,
   term_image.tid AS term_image_tid,
   draggableviews_structure_node0.value AS draggableviews_structure_node0_value
 FROM {node} node 
 LEFT JOIN {term_node} term_node ON node.vid = term_node.vid
 LEFT JOIN {term_data} term_data ON term_node.tid = term_data.tid
 LEFT JOIN {content_field_showinview} node_data_field_showinview ON node.vid = node_data_field_showinview.vid
 LEFT JOIN {term_image} term_image ON term_node.tid = term_image.tid
 LEFT JOIN {draggableviews_structure} draggableviews_structure_node0 ON node.nid = draggableviews_structure_node0.nid AND (draggableviews_structure_node0.delta = 0 AND draggableviews_structure_node0.view_name = 'Produkte' AND draggableviews_structure_node0.args = '')
 WHERE (term_data.vid in ('%s')) AND (node_data_field_showinview.field_showinview_value IS NOT NULL) AND (node.language in ('%s', '%s'))
 GROUP BY nid
  ORDER BY draggableviews_structure_node0_value ASC