Skip to content

Commit

Permalink
DNET-317
Browse files Browse the repository at this point in the history
DNET-329
  • Loading branch information
cincuranet committed Jul 17, 2010
1 parent fb3b2ac commit ffe5278
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 11 deletions.
18 changes: 17 additions & 1 deletion NETProvider/source/FirebirdSql/Data/Isql/FbBatchExecution.cs
Expand Up @@ -17,6 +17,7 @@
*
* Contributors:
* Jiri Cincura (jiri@cincura.net)
* Olivier Metod
*/

#if (!NET_CF)
Expand Down Expand Up @@ -265,6 +266,7 @@ public void Execute(bool autoCommit)
this.OnCommandExecuted(sqlStatement, null, -1);
break;

case SqlStatementType.CommentOn:
case SqlStatementType.CreateDomain:
case SqlStatementType.CreateException:
case SqlStatementType.CreateGenerator:
Expand Down Expand Up @@ -326,6 +328,7 @@ public void Execute(bool autoCommit)
case SqlStatementType.DropGenerator:
case SqlStatementType.DropIndex:
case SqlStatementType.DropProcedure:
case SqlStatementType.DropSequence:
case SqlStatementType.DropRole:
case SqlStatementType.DropShadow:
case SqlStatementType.DropTable:
Expand Down Expand Up @@ -409,6 +412,7 @@ public void Execute(bool autoCommit)
break;

case SqlStatementType.SetGenerator:
case SqlStatementType.AlterSequence:
// raise the event
this.OnCommandExecuting(this.sqlCommand);

Expand Down Expand Up @@ -781,6 +785,10 @@ public static SqlStatementType GetStatementType(string sqlStatement)
{
return SqlStatementType.AlterProcedure;
}
if (StringParser.StartsWith(sqlStatement, "ALTER SEQUENCE", true))
{
return SqlStatementType.AlterSequence;
}
if (StringParser.StartsWith(sqlStatement, "ALTER TABLE", true))
{
return SqlStatementType.AlterTable;
Expand All @@ -802,6 +810,10 @@ public static SqlStatementType GetStatementType(string sqlStatement)
throw new Exception("The type of the SQL statement could not be determinated.");

case 'O':
if (StringParser.StartsWith(sqlStatement, "COMMENT ON", true))
{
return SqlStatementType.CommentOn;
}
if (StringParser.StartsWith(sqlStatement, "COMMIT", true))
{
return SqlStatementType.Commit;
Expand Down Expand Up @@ -848,7 +860,7 @@ public static SqlStatementType GetStatementType(string sqlStatement)
}
if (StringParser.StartsWith(sqlStatement, "CREATE SEQUENCE", true))
{
return SqlStatementType.CreateSequence;
return SqlStatementType.CreateSequence;
}
if (StringParser.StartsWith(sqlStatement, "CREATE SHADOW", true))
{
Expand Down Expand Up @@ -956,6 +968,10 @@ public static SqlStatementType GetStatementType(string sqlStatement)
{
return SqlStatementType.DropProcedure;
}
if (StringParser.StartsWith(sqlStatement, "DROP SEQUENCE", true))
{
return SqlStatementType.DropSequence;
}
if (StringParser.StartsWith(sqlStatement, "DROP ROLE", true))
{
return SqlStatementType.DropRole;
Expand Down
39 changes: 29 additions & 10 deletions NETProvider/source/FirebirdSql/Data/Isql/SqlStatementType.cs
Expand Up @@ -14,6 +14,10 @@
*
* Copyright (c) 2003, 2005 Abel Eduardo Pereira
* All Rights Reserved.
*
* Contributors:
* Jiri Cincura (jiri@cincura.net)
* Olivier Metod
*/

#if (!NET_CF)
Expand Down Expand Up @@ -46,12 +50,17 @@ public enum SqlStatementType
/// <summary>
/// Represents the SQL statement: <b>ALTER INDEX</b>
/// </summary>
AlterIndex,
AlterIndex,

/// <summary>
/// Represents the SQL statement: <b>ALTER PROCEDURE</b>
/// </summary>
AlterProcedure,
/// <summary>
/// Represents the SQL statement: <b>ALTER PROCEDURE</b>
/// </summary>
AlterProcedure,

/// <summary>
/// Represents the SQL statement: <b>ALTER SEQUENCE</b>
/// </summary>
AlterSequence,

/// <summary>
/// Represents the SQL statement: <b>ALTER TABLE</b>
Expand All @@ -68,6 +77,11 @@ public enum SqlStatementType
/// </summary>
Close,

/// <summary>
/// Represents the SQL statement: <b>COMMENT ON</b>
/// </summary>
CommentOn,

/// <summary>
/// Represents the SQL statement: <b>COMMIT</b>
/// </summary>
Expand Down Expand Up @@ -211,12 +225,17 @@ public enum SqlStatementType
/// <summary>
/// Represents the SQL statement: <b>DROP INDEX</b>
/// </summary>
DropIndex,
DropIndex,

/// <summary>
/// Represents the SQL statement: <b>DROP PROCEDURE</b>
/// </summary>
DropProcedure,
/// <summary>
/// Represents the SQL statement: <b>DROP PROCEDURE</b>
/// </summary>
DropProcedure,

/// <summary>
/// Represents the SQL statement: <b>DROP SEQUENCE</b>
/// </summary>
DropSequence,

/// <summary>
/// Represents the SQL statement: <b>DROP ROLE</b>
Expand Down

0 comments on commit ffe5278

Please sign in to comment.