More loopy looism

Here's a little thing I was forced to realise after a far too high profile site when slightly wrong (in a far too big way).

Looping a query inside a loop of another query changes the way you can refer to the outer-loops current row. Running the following code demonstrates this:

    qry_foo = QueryNew('foo');
    QueryAddRow(qry_foo, 3);
    for(i=1; i LTE 3; i=i+1){
        QuerySetCell(qry_foo,'foo',"foo #i#",i);
    qry_bar = QueryNew("bar");
    QueryAddRow(qry_bar, 10);
    for(i=1; i LTE 10; i=i+1){
        QuerySetCell(qry_bar,'bar',"bar #i#",i);
        <cfloop query="qry_foo">
                    <cfloop query="qry_bar">

The problem is that you cannot access the current row of the qry_foo query when inside the loop of qry_bar in this way. Instead, you would have to use:[qry_foo.currentRow]

Does anyone else find this bizarre?