Skip to content

copy clears a part of a subquery #196

@weha

Description

@weha

When I build up a query with a subquery and use a copy the first query will be good but the second query will miss the subquery itself.

Example:
$dbi_sub = $dbi->subQuery();
$dbi_sub->where('mycompany_members.active',1);
$dbi_sub->get('mycompany_members',null,'member');
$dbi->where('members.id',$dbi_sub,'IN');

This one works
$cnt = $dbi->copy();
$count_members = $cnt->getOne('members',"COUNT(members.id) AS count");

snip: members.id IN ( (SELECT member FROM mycompany_members WHERE mycompany_members.active = 1 ) )

This one does not
$data = $dbi->get('members',array($limit_from,$itemsperpage),array("array","off","colums"));

snip: members.id IN ( () )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions