Changeset 19094 for trunk/FACT++/src


Ignore:
Timestamp:
07/29/18 19:58:51 (6 years ago)
Author:
tbretz
Message:
Some more improvemnts to the EXPLAIN formating.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/rootifysql.cc

    r19093 r19094  
    137137    vector<string> queries;
    138138
    139     string resub(string str, size_t indent)
     139    string resub(string str)
    140140    {
    141141        // search for "KEYWORD expression"
     
    152152            const auto idx = atoi(arg.c_str()+1);
    153153
    154             str.replace(pos, len, resub(vec[idx], indent));
     154            str.replace(pos, len, resub(vec[idx]));
    155155        }
    156156
     
    175175                if (vec[idx].substr(0,2)=="({")
    176176                {
    177                     cout << setw(indent) << ' ' << "(" << resub(vec[idx], indent+4) << ") ";
     177                    cout << setw(indent) << ' ' << "(" << resub(vec[idx]) << ") ";
    178178                }
    179179                else
     
    181181                    if (indent>0)
    182182                        cout << setw(indent) << ' ';
    183                     cout << vec[idx];
     183                    cout << resub(vec[idx]);
    184184                }
    185185        }
     
    188188            if (indent>0)
    189189                cout << setw(indent) << ' ';
    190             cout << expr;
     190            cout << resub(expr);
    191191        }
    192192    }
     
    199199        const string _com = "\\/\\*\\ select\\#[0-9]+\\ \\*\\/\\ *";
    200200
    201         const string _tok = "[a-zA-Z ]+";
     201        const string _tok = "[a-zA-Z_ ]+";
    202202
    203203        const string _nnn = "\\{[0-9]+\\}|[0-9]+";
     
    261261
    262262        // substitute all paranthesis
    263         sql = substitute(sql, "\\([^\\(\\)]*\\)");
     263        sql = substitute(sql, "[a-zA-Z0-9_]*\\([^\\(\\)]*\\)");
    264264
    265265        //cout << sql << "\n\n";
Note: See TracChangeset for help on using the changeset viewer.