mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-01 18:25:59 +00:00
106 lines
33 KiB
HTML
106 lines
33 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
|
|
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>SQLParser</title><link rel="stylesheet" type="text/css" href="../../styles/main.css"><script language=JavaScript src="../../javascript/main.js"></script><script language=JavaScript src="../../javascript/prettify.js"></script><script language=JavaScript src="../../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
|
|
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
|
|
|
|
<!-- Generated by Natural Docs, version 1.52 -->
|
|
<!-- http://www.naturaldocs.org -->
|
|
|
|
<!-- saved from url=(0026)http://www.naturaldocs.org -->
|
|
|
|
|
|
|
|
|
|
<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="SQLParser"></a>SQLParser</h1><div class=CBody><p>SQLParser parses common MySQL SQL statements into data structures. This parser is MySQL-specific and intentionally meant to handle only “common” cases. Although there are many limiations (like UNION, CASE, etc.), many complex cases are handled that no other free, Perl SQL parser at the time of writing can parse, notably subqueries in all their places and varieties.</p><p>This package has not been profiled and since it relies heavily on mildly complex regex, so do not expect amazing performance.</p><p>See SQLParser.t for examples of the various data structures. There are many and they vary a lot depending on the statment parsed, so documentation in this file is not exhaustive.</p><p>This package differs from QueryParser because here we parse the entire SQL statement (thus giving access to all its parts), whereas QueryParser extracts just needed parts (and ignores all the rest).</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#SQLParser" >SQLParser</a></td><td class=SDescription>SQLParser parses common MySQL SQL statements into data structures. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SQLParser.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#SQLParser.$quoted_ident" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">$quoted_ident</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#SQLParser.$unquoted_ident" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">$unquoted_ident</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#SQLParser.$ident_alias" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">$ident_alias</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#SQLParser.$table_ident" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">$table_ident</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#SQLParser.$column_ident" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">$column_ident</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#SQLParser.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SQLParser.new" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">new</a></td><td class=SDescription>Create a SQLParser object.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SQLParser.parse" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">parse</a></td><td class=SDescription>Parse a SQL statment. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SQLParser._parse_clauses" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">_parse_clauses</a></td><td class=SDescription>Parse raw text of clauses into data structures. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SQLParser.clean_query" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">clean_query</a></td><td class=SDescription>Remove spaces, flatten, and normalize some patterns for easier parsing.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SQLParser.normalize_keyword_spaces" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">normalize_keyword_spaces</a></td><td class=SDescription>Normalize spaces around certain SQL keywords. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SQLParser._parse_query" >_parse_query</a></td><td class=SDescription>This sub is called by the parse_TYPE subs except parse_insert. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SQLParser.parse_from" >parse_from</a></td><td class=SDescription>Parse a FROM clause, a.k.a. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SQLParser.parse_identifiers" >parse_identifiers</a></td><td class=SDescription>Parse an arrayref of identifiers into their parts. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#SQLParser.split_unquote" >split_unquote</a></td><td class=SDescription>Split and unquote a table name. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#SQLParser.is_identifier" >is_identifier</a></td><td class=SDescription>Determine if something is a schema object identifier. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
|
|
|
|
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SQLParser.Variables"></a>Variables</h3></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SQLParser.$quoted_ident"></a>$quoted_ident</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">my $quoted_ident</td></tr></table></blockquote></div></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SQLParser.$unquoted_ident"></a>$unquoted_ident</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">my $unquoted_ident</td></tr></table></blockquote></div></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SQLParser.$ident_alias"></a>$ident_alias</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">my $ident_alias</td></tr></table></blockquote></div></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SQLParser.$table_ident"></a>$table_ident</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">my $table_ident</td></tr></table></blockquote></div></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="SQLParser.$column_ident"></a>$column_ident</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">my $column_ident</td></tr></table></blockquote></div></div></div>
|
|
|
|
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="SQLParser.Functions"></a>Functions</h3></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SQLParser.new"></a>new</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">sub new</td></tr></table></blockquote><p>Create a SQLParser object.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>%args</td><td class=CDLDescription>Arguments</td></tr></table><h4 class=CHeading>Optional Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>Schema</td><td class=CDLDescription><a href="Schema-pm.html#Schema" class=LClass id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">Schema</a> object. Can be set later by calling <set_Schema()>.</td></tr></table><h4 class=CHeading>Returns</h4><p>SQLParser object</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SQLParser.parse"></a>parse</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">sub parse</td></tr></table></blockquote><p>Parse a SQL statment. Only statements of $allowed_types are parsed. This sub recurses to parse subqueries.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$query</td><td class=CDLDescription>SQL statement</td></tr></table><h4 class=CHeading>Returns</h4><p>A complex hashref of the parsed SQL statment. All keys and almost all values are lowercase for consistency. The struct is roughly:</p><blockquote><pre class="prettyprint">{
|
|
type => '', # one of $allowed_types
|
|
clauses => {}, # raw, unparsed text of clauses
|
|
<clause> => struct # parsed clause struct, e.g. from => [<tables>]
|
|
keywords => {}, # LOW_PRIORITY, DISTINCT, SQL_CACHE, etc.
|
|
functions => {}, # MAX(), SUM(), NOW(), etc.
|
|
select => {}, # SELECT struct for INSERT/REPLACE ... SELECT
|
|
subqueries => [], # pointers to subquery structs
|
|
}</pre></blockquote><p>It varies, of course, depending on the query. If something is missing it means the query doesn’t have that part. E.g. INSERT has an INTO clause but DELETE does not, and only DELETE and SELECT have FROM clauses. Each clause struct is different; see their respective parse_CLAUSE subs.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SQLParser._parse_clauses"></a>_parse_clauses</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">sub _parse_clauses</td></tr></table></blockquote><p>Parse raw text of clauses into data structures. This sub recurses to parse the clauses of subqueries. The clauses are read from and their data structures saved into the $struct parameter.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$struct</td><td class=CDLDescription>Hashref from which clauses are read (%{$struct->{clauses}}) and into which data structs are saved (e.g. $struct->{from}=...).</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SQLParser.clean_query"></a>clean_query</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">sub clean_query</td></tr></table></blockquote><p>Remove spaces, flatten, and normalize some patterns for easier parsing.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$query</td><td class=CDLDescription>SQL statement</td></tr></table><h4 class=CHeading>Returns</h4><p>Cleaned $query</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SQLParser.normalize_keyword_spaces"></a>normalize_keyword_spaces</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">sub normalize_keyword_spaces</td></tr></table></blockquote><p>Normalize spaces around certain SQL keywords. Spaces are added and removed around certain SQL keywords to make parsing easier.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$query</td><td class=CDLDescription>SQL statement</td></tr></table><h4 class=CHeading>Returns</h4><p>Normalized $query</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SQLParser._parse_query"></a>_parse_query</h3><div class=CBody><p>This sub is called by the parse_TYPE subs except parse_insert. It does two things: remove, save the given keywords, all of which should appear at the beginning of the query; and, save (but not remove) the given clauses. The query should start with the values for the first clause because the query’s first word was removed in parse(). So for “SELECT cols FROM ...”, the query given here is “cols FROM ...” where “cols” belongs to the first clause “columns”. Then the query is walked clause-by-clause, saving each.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$query</td><td class=CDLDescription>SQL statement with first word (SELECT, INSERT, etc.) removed</td></tr><tr><td class=CDLEntry>$keywords</td><td class=CDLDescription>Compiled regex of keywords that can appear in $query</td></tr><tr><td class=CDLEntry>$first_clause</td><td class=CDLDescription>First clause word to expect in $query</td></tr><tr><td class=CDLEntry>$clauses</td><td class=CDLDescription>Compiled regex of clause words that can appear in $query</td></tr></table><h4 class=CHeading>Returns</h4><p>Hashref with raw text of clauses</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SQLParser.parse_from"></a>parse_from</h3><div class=CBody><p>Parse a FROM clause, a.k.a. the table references. Does not handle nested joins. See <a href="http://dev.mysql.com/doc/refman/5.1/en/join.html" class=LURL target=_top>http://dev.mysql.com/doc/refman/5.1/en/join.html</a></p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$from</td><td class=CDLDescription>FROM clause (with the word “FROM”)</td></tr></table><h4 class=CHeading>Returns</h4><p>Arrayref of hashrefs, one hashref for each table in the order that the tables appear, like:</p><blockquote><pre class="prettyprint">{
|
|
name => 't2', -- table's real name
|
|
alias => 'b', -- table's alias, if any
|
|
explicit_alias => 1, -- if explicitly aliased with AS
|
|
join => { -- if joined to another table, all but first
|
|
-- table are because comma implies INNER JOIN
|
|
to => 't1', -- table name on left side of join, if this is
|
|
-- LEFT JOIN then this is the inner table, if
|
|
-- RIGHT JOIN then this is outer table
|
|
type => '', -- left, right, inner, outer, cross, natural
|
|
condition => 'using', -- on or using, if applicable
|
|
columns => ['id'], -- columns for USING condition, if applicable
|
|
ansi => 1, -- true of ANSI JOIN, i.e. true if not implicit
|
|
-- INNER JOIN due to following a comma
|
|
},
|
|
},
|
|
{
|
|
name => 't3',
|
|
join => {
|
|
to => 't2',
|
|
type => 'left',
|
|
condition => 'on', -- an ON condition is like a WHERE clause so
|
|
where => [...] -- this arrayref of predicates appears, see
|
|
-- <parse_where()> for its structure
|
|
},
|
|
},</pre></blockquote></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SQLParser.parse_identifiers"></a>parse_identifiers</h3><div class=CBody><p>Parse an arrayref of identifiers into their parts. Identifiers can be column names (optionally qualified), expressions, or constants. GROUP BY and ORDER BY specify a list of identifiers.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$idents</td><td class=CDLDescription>Arrayref of indentifiers</td></tr></table><h4 class=CHeading>Returns</h4><p>Arrayref of hashes with each identifier’s parts, depending on what kind of identifier it is.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SQLParser.split_unquote"></a>split_unquote</h3><div class=CBody><p>Split and unquote a table name. The table name can be database-qualified or not, like `db`.`table`. The table name can be backtick-quoted or not.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$db_tbl</td><td class=CDLDescription>Table name</td></tr><tr><td class=CDLEntry>$default_db</td><td class=CDLDescription>Default database name to return if $db_tbl is not database-qualified</td></tr></table><h4 class=CHeading>Returns</h4><p>Array: unquoted database (possibly undef), unquoted table</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="SQLParser.is_identifier"></a>is_identifier</h3><div class=CBody><p>Determine if something is a schema object identifier. E.g.: `tbl` is an identifier, but “tbl” is a string and 1 is a number. See <a href="http://dev.mysql.com/doc/refman/5.1/en/identifiers.html" class=LURL target=_top>http://dev.mysql.com<wbr>/doc<wbr>/refman<wbr>/5.1<wbr>/en<wbr>/identifiers.html</a></p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$thing</td><td class=CDLDescription>Name of something, including any quoting as it appears in a query.</td></tr></table><h4 class=CHeading>Returns</h4><p>True of $thing is an identifier, else false.</p></div></div></div>
|
|
|
|
</div><!--Content-->
|
|
|
|
|
|
<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
|
|
|
|
|
|
<div id=Menu><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Modules</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="Advisor-pm.html">Advisor</a></div></div><div class=MEntry><div class=MFile><a href="AdvisorRules-pm.html">AdvisorRules</a></div></div><div class=MEntry><div class=MFile><a href="BinaryLogParser-pm.html">BinaryLogParser</a></div></div><div class=MEntry><div class=MFile><a href="ChangeHandler-pm.html">ChangeHandler</a></div></div><div class=MEntry><div class=MFile><a href="CompareQueryTimes-pm.html">CompareQueryTimes</a></div></div><div class=MEntry><div class=MFile><a href="CompareResults-pm.html">CompareResults</a></div></div><div class=MEntry><div class=MFile><a href="CompareTableStructs-pm.html">CompareTableStructs</a></div></div><div class=MEntry><div class=MFile><a href="CompareWarnings-pm.html">CompareWarnings</a></div></div><div class=MEntry><div class=MFile><a href="CopyRowsInsertSelect-pm.html">CopyRowsInsertSelect</a></div></div><div class=MEntry><div class=MFile><a href="Daemon-pm.html">Daemon</a></div></div><div class=MEntry><div class=MFile><a href="DSNParser-pm.html">DSNParser</a></div></div><div class=MEntry><div class=MFile><a href="DuplicateKeyFinder-pm.html">DuplicateKeyFinder</a></div></div><div class=MEntry><div class=MFile><a href="EventAggregator-pm.html">EventAggregator</a></div></div><div class=MEntry><div class=MFile><a href="EventTimeline-pm.html">EventTimeline</a></div></div><div class=MEntry><div class=MFile><a href="ExecutionThrottler-pm.html">ExecutionThrottler</a></div></div><div class=MEntry><div class=MFile><a href="ExplainAnalyzer-pm.html">ExplainAnalyzer</a></div></div><div class=MEntry><div class=MFile><a href="FileIterator-pm.html">FileIterator</a></div></div><div class=MEntry><div class=MFile><a href="ForeignKeyIterator-pm.html">ForeignKeyIterator</a></div></div><div class=MEntry><div class=MFile><a href="GeneralLogParser-pm.html">GeneralLogParser</a></div></div><div class=MEntry><div class=MFile><a href="HTTPProtocolParser-pm.html">HTTPProtocolParser</a></div></div><div class=MEntry><div class=MFile><a href="IndexUsage-pm.html">IndexUsage</a></div></div><div class=MEntry><div class=MFile><a href="InnoDBStatusParser-pm.html">InnoDBStatusParser</a></div></div><div class=MEntry><div class=MFile><a href="KeySize-pm.html">KeySize</a></div></div><div class=MEntry><div class=MFile><a href="LogSplitter-pm.html">LogSplitter</a></div></div><div class=MEntry><div class=MFile><a href="MaatkitTest-pm.html">MaatkitTest</a></div></div><div class=MEntry><div class=MFile><a href="MasterSlave-pm.html">MasterSlave</a></div></div><div class=MEntry><div class=MFile><a href="MemcachedEvent-pm.html">MemcachedEvent</a></div></div><div class=MEntry><div class=MFile><a href="MemcachedProtocolParser-pm.html">MemcachedProtocolParser</a></div></div><div class=MEntry><div class=MFile><a href="MockSth-pm.html">MockSth</a></div></div><div class=MEntry><div class=MFile><a href="MockSync-pm.html">MockSync</a></div></div><div class=MEntry><div class=MFile><a href="MockSyncStream-pm.html">MockSyncStream</a></div></div><div class=MEntry><div class=MFile><a href="MySQLConfig-pm.html">MySQLConfig</a></div></div><div class=MEntry><div class=MFile><a href="MySQLConfigComparer-pm.html">MySQLConfigComparer</a></div></div><div class=MEntry><div class=MFile><a href="MySQLDump-pm.html">MySQLDump</a></div></div><div class=MEntry><div class=MFile><a href="MySQLProtocolParser-pm.html">MySQLProtocolParser</a></div></div><div class=MEntry><div class=MFile><a href="OptionParser-pm.html">OptionParser</a></div></div><div class=MEntry><div class=MFile><a href="OSCCaptureSync-pm.html">OSCCaptureSync</a></div></div><div class=MEntry><div class=MFile><a href="Outfile-pm.html">Outfile</a></div></div><div class=MEntry><div class=MFile><a href="PgLogParser-pm.html">PgLogParser</a></div></div><div class=MEntry><div class=MFile><a href="Pipeline-pm.html">Pipeline</a></div></div><div class=MEntry><div class=MFile><a href="PodParser-pm.html">PodParser</a></div></div><div class=MEntry><div class=MFile><a href="Processlist-pm.html">Processlist</a></div></div><div class=MEntry><div class=MFile><a href="ProcesslistAggregator-pm.html">ProcesslistAggregator</a></div></div><div class=MEntry><div class=MFile><a href="Progress-pm.html">Progress</a></div></div><div class=MEntry><div class=MFile><a href="ProtocolParser-pm.html">ProtocolParser</a></div></div><div class=MEntry><div class=MFile><a href="QueryAdvisorRules-pm.html">QueryAdvisorRules</a></div></div><div class=MEntry><div class=MFile><a href="QueryParser-pm.html">QueryParser</a></div></div><div class=MEntry><div class=MFile><a href="QueryReportFormatter-pm.html">QueryReportFormatter</a></div></div><div class=MEntry><div class=MFile><a href="QueryReview-pm.html">QueryReview</a></div></div><div class=MEntry><div class=MFile><a href="QueryRewriter-pm.html">QueryRewriter</a></div></div><div class=MEntry><div class=MFile><a href="Quoter-pm.html">Quoter</a></div></div><div class=MEntry><div class=MFile><a href="ReportFormatter-pm.html">ReportFormatter</a></div></div><div class=MEntry><div class=MFile><a href="Retry-pm.html">Retry</a></div></div><div class=MEntry><div class=MFile><a href="RowDiff-pm.html">RowDiff</a></div></div><div class=MEntry><div class=MFile><a href="Runtime-pm.html">Runtime</a></div></div><div class=MEntry><div class=MFile><a href="Sandbox-pm.html">Sandbox</a></div></div><div class=MEntry><div class=MFile><a href="Schema-pm.html">Schema</a></div></div><div class=MEntry><div class=MFile><a href="SchemaIterator-pm.html">SchemaIterator</a></div></div><div class=MEntry><div class=MFile><a href="SimpleTCPDumpParser-pm.html">SimpleTCPDumpParser</a></div></div><div class=MEntry><div class=MFile><a href="SlowLogParser-pm.html">SlowLogParser</a></div></div><div class=MEntry><div class=MFile><a href="SlowLogWriter-pm.html">SlowLogWriter</a></div></div><div class=MEntry><div class=MFile id=MSelected>SQLParser</div></div><div class=MEntry><div class=MFile><a href="SysLogParser-pm.html">SysLogParser</a></div></div><div class=MEntry><div class=MFile><a href="TableChecksum-pm.html">TableChecksum</a></div></div><div class=MEntry><div class=MFile><a href="TableChunker-pm.html">TableChunker</a></div></div><div class=MEntry><div class=MFile><a href="TableNibbler-pm.html">TableNibbler</a></div></div><div class=MEntry><div class=MFile><a href="TableParser-pm.html">TableParser</a></div></div><div class=MEntry><div class=MFile><a href="TableSyncChunk-pm.html">TableSyncChunk</a></div></div><div class=MEntry><div class=MFile><a href="TableSyncer-pm.html">TableSyncer</a></div></div><div class=MEntry><div class=MFile><a href="TableSyncGroupBy-pm.html">TableSyncGroupBy</a></div></div><div class=MEntry><div class=MFile><a href="TableSyncNibble-pm.html">TableSyncNibble</a></div></div><div class=MEntry><div class=MFile><a href="TableSyncStream-pm.html">TableSyncStream</a></div></div><div class=MEntry><div class=MFile><a href="TableUsage-pm.html">TableUsage</a></div></div><div class=MEntry><div class=MFile><a href="TcpdumpParser-pm.html">TcpdumpParser</a></div></div><div class=MEntry><div class=MFile><a href="TCPRequestAggregator-pm.html">TCPRequestAggregator</a></div></div><div class=MEntry><div class=MFile><a href="TextResultSetParser-pm.html">TextResultSetParser</a></div></div><div class=MEntry><div class=MFile><a href="TimeSeriesTrender-pm.html">TimeSeriesTrender</a></div></div><div class=MEntry><div class=MFile><a href="Transformers-pm.html">Transformers</a></div></div><div class=MEntry><div class=MFile><a href="UpgradeReportFormatter-pm.html">UpgradeReportFormatter</a></div></div><div class=MEntry><div class=MFile><a href="VariableAdvisorRules-pm.html">VariableAdvisorRules</a></div></div><div class=MEntry><div class=MFile><a href="VersionParser-pm.html">VersionParser</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Tools</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MFile><a href="../tools/pt-archiver-pm.html">pt_archiver</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-config-diff-pm.html">pt_config_diff</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-deadlock-logger-pm.html">pt_deadlock_logger</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-duplicate-key-checker-pm.html">pt_duplicate_key_checker</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-fifo-split-pm.html">pt_fifo_split</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-find-pm.html">pt_find</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-fk-error-logger-pm.html">pt_fk_error_logger</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-heartbeat-pm.html">pt_heartbeat</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-index-usage-pm.html">pt_index_usage</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-kill-pm.html">pt_kill</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-log-player-pm.html">pt_log_player</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-online-schema-change-pm.html">pt_online_schema_change</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-profile-compact-pm.html">pt_profile_compact</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-query-advisor-pm.html">pt_query_advisor</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-query-digest-pm.html">pt_query_digest</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-query-profiler-pm.html">pt_query_profiler</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-schema-advisor-pm.html">pt_schema_advisor</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-show-grants-pm.html">pt_show_grants</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-slave-delay-pm.html">pt_slave_delay</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-slave-find-pm.html">pt_slave_find</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-slave-restart-pm.html">pt_slave_restart</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-table-checksum-pm.html">pt_table_checksum</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-table-sync-pm.html">pt_table_sync</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-table-usage-pm.html">pt_table_usage</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-tcp-model-pm.html">pt_tcp_model</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-trend-pm.html">pt_trend</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-upgrade-pm.html">pt_upgrade</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-variable-advisor-pm.html">pt_variable_advisor</a></div></div><div class=MEntry><div class=MFile><a href="../tools/pt-visual-explain-pm.html">pt_visual_explain</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent3')">Index</a><div class=MGroupContent id=MGroupContent3><div class=MEntry><div class=MIndex><a href="../../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Variables.html">Variables</a></div></div></div></div></div><script type="text/javascript"><!--
|
|
var searchPanel = new SearchPanel("searchPanel", "HTML", "../../search");
|
|
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Functions">Functions</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
|
|
HideAllBut([1], 4);// --></script></div><!--Menu-->
|
|
|
|
|
|
|
|
<!--START_ND_TOOLTIPS-->
|
|
<div class=CToolTip id="tt1"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">my $quoted_ident</td></tr></table></blockquote></div></div><div class=CToolTip id="tt2"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">my $unquoted_ident</td></tr></table></blockquote></div></div><div class=CToolTip id="tt3"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">my $ident_alias</td></tr></table></blockquote></div></div><div class=CToolTip id="tt4"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">my $table_ident</td></tr></table></blockquote></div></div><div class=CToolTip id="tt5"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">my $column_ident</td></tr></table></blockquote></div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">sub new</td></tr></table></blockquote>Create a SQLParser object.</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">sub parse</td></tr></table></blockquote>Parse a SQL statment. </div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">sub _parse_clauses</td></tr></table></blockquote>Parse raw text of clauses into data structures. </div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">sub clean_query</td></tr></table></blockquote>Remove spaces, flatten, and normalize some patterns for easier parsing.</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">sub normalize_keyword_spaces</td></tr></table></blockquote>Normalize spaces around certain SQL keywords. </div></div><div class=CToolTip id="tt11"><div class=CClass>Schema encapsulates a data structure representing databases and tables. </div></div><!--END_ND_TOOLTIPS-->
|
|
|
|
|
|
|
|
|
|
<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>
|
|
|
|
|
|
<script language=JavaScript><!--
|
|
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |