Implement UserVariableBuilder in FunctionBuilder to build for custom variable.
This changes solve issues of subtree with user_variable expr_type when building parsed query.
Solve this error while building query.
Message: unknown [expr_type] = user_variable in "function subtree
To reproduce:
$sql = 'select demoid as id, parent_id as pid, name from (select demoid, parent_id, d.name as name from tbldemos as d order by d.parent_id, d.demoid) demos_sorted, (select @pv := "0") initialisation where find_in_set(parent_id, @pv) and length(@pv := concat(@pv, ",", demoid))';
$parser = new PHPSQLParser($sql);
$parsed = $parser->parsed;
//building sql will fail without this commit.
$creator = new PHPSQLCreator($parsed);
$newSql = $creator->created;
Implement UserVariableBuilder in FunctionBuilder to build for custom variable.
This changes solve issues of subtree with user_variable expr_type when building parsed query.
Solve this error while building query.
Message: unknown [expr_type] = user_variable in "function subtree
To reproduce: