AQL requires that the first level query is either from tables or from subqueries/withQuery
(s2aCtx *SQL2AqlContext)
| 1781 | |
| 1782 | // AQL requires that the first level query is either from tables or from subqueries/withQuery |
| 1783 | func (v *ASTBuilder) isQueryFromMixed(s2aCtx *SQL2AqlContext) (bool, error) { |
| 1784 | var flagTable bool |
| 1785 | var err error |
| 1786 | if len(s2aCtx.MapJoinTables[0][0].Table) != 0 { |
| 1787 | flagTable = true |
| 1788 | } |
| 1789 | for i, join := range s2aCtx.MapJoinTables[0] { |
| 1790 | if flagTable && len(join.Table) == 0 { |
| 1791 | err = fmt.Errorf("# %d should be a tablename in from clause", i) |
| 1792 | return true, err |
| 1793 | } else if !flagTable && len(join.Table) != 0 { |
| 1794 | err = fmt.Errorf("# %d should be a subquery/withQuery in from clause", i) |
| 1795 | return true, err |
| 1796 | } |
| 1797 | } |
| 1798 | return false, nil |
| 1799 | } |
| 1800 | |
| 1801 | // AQL requires that all subqueries or withQuery from clauses are same |
| 1802 | func (v *ASTBuilder) isSameFromTables(s2aCtx *SQL2AqlContext, mapKey int) (bool, error) { |
no test coverage detected