Skip to content

Commit

Permalink
Version 3.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
edwig committed Apr 17, 2023
1 parent a3912a8 commit c4f563c
Show file tree
Hide file tree
Showing 40 changed files with 1,524 additions and 265 deletions.
2 changes: 2 additions & 0 deletions BaseLibrary/BaseLibrary.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
<ClInclude Include="StdException.h" />
<ClInclude Include="StoreMessage.h" />
<ClInclude Include="StringUtilities.h" />
<ClInclude Include="XSDSchema.h" />
<ClInclude Include="XStringBuilder.h" />
<ClInclude Include="targetver.h" />
<ClInclude Include="unzip.h" />
Expand Down Expand Up @@ -233,6 +234,7 @@
<ClCompile Include="StdException.cpp" />
<ClCompile Include="StoreMessage.cpp" />
<ClCompile Include="StringUtilities.cpp" />
<ClCompile Include="XSDSchema.cpp" />
<ClCompile Include="XStringBuilder.cpp" />
<ClCompile Include="unzip.cpp" />
<ClCompile Include="WideMessageBox.cpp" />
Expand Down
12 changes: 9 additions & 3 deletions BaseLibrary/BaseLibrary.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,11 @@
<ClInclude Include="AuthenticationHeader.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="XSDSchema.h">
<Filter>Header Files\XML_SOAP</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="bcd.cpp">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down Expand Up @@ -485,5 +485,11 @@
<ClCompile Include="AuthenticationHeader.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="XSDSchema.cpp">
<Filter>Source Files\XML_SOAP</Filter>
</ClCompile>
<ClCompile Include="pch.cpp">
<Filter>Configuration</Filter>
</ClCompile>
</ItemGroup>
</Project>
21 changes: 20 additions & 1 deletion BaseLibrary/QueryReWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ static const char* all_tokens[] =
,"HAVING"
,"INTO"
,"UNION"
,"STATISTICS"
,"FOR"
};

// All registered SQL words including tokens and special registrations
Expand Down Expand Up @@ -334,21 +336,36 @@ QueryReWriter::ParseStatement(bool p_closingEscape /*= false*/)
odbc = true;
}

if(m_token == Token::TK_STATISTICS)
{
m_inStatement = m_token;
PrintToken();
continue;
}
if(m_token == Token::TK_FOR)
{
m_nextTable = false;
}

// Append schema
if(m_nextTable)
{
AppendSchema();
}

// Find next table for appending a schema
if(m_inStatement == Token::TK_SELECT && (m_token == Token::TK_FROM || m_token == Token::TK_JOIN))
if(m_inStatement == Token::TK_SELECT && (m_token == Token::TK_FROM || m_token == Token::TK_JOIN ))
{
m_nextTable = true;
if(m_token == Token::TK_FROM)
{
m_inFrom = true;
}
}
if(m_inStatement == Token::TK_STATISTICS && m_token == Token::TK_FOR)
{
m_nextTable = true;
}
if(m_inStatement == Token::TK_SELECT && m_inFrom && m_token == Token::TK_COMMA)
{
m_nextTable = true;
Expand Down Expand Up @@ -454,6 +471,8 @@ QueryReWriter::PrintToken()
case Token::TK_ORDER: [[fallthrough]];
case Token::TK_HAVING: [[fallthrough]];
case Token::TK_INTO: [[fallthrough]];
case Token::TK_STATISTICS:[[fallthrough]];
case Token::TK_FOR: [[fallthrough]];
case Token::TK_UNION: m_output += all_tokens[(int)m_token];
break;
case Token::TK_EOS: break;
Expand Down
2 changes: 2 additions & 0 deletions BaseLibrary/QueryReWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ enum class Token
,TK_HAVING
,TK_INTO
,TK_UNION
,TK_STATISTICS
,TK_FOR
};

enum class SROption
Expand Down
Loading

0 comments on commit c4f563c

Please sign in to comment.