--- trunk/lib/SQLSession/Action/DoSQL.pm 2006/12/02 22:30:43 7 +++ trunk/lib/SQLSession/Action/DoSQL.pm 2006/12/02 22:54:15 8 @@ -49,10 +49,15 @@ =cut -sub valdate_sql_query { +sub validate_sql_query { my $self = shift; - my $value = shift || return $self->validation_error( sql_query => 'You need to type in SQL query' ); - return $self->validation_ok('sql_query'); + my $value = shift; + + if ( $value =~ m/^\s+;*\s*$/s ) { + return $self->validation_error( sql_query => 'You need to type in SQL query' ); + } else { + return $self->validation_ok('sql_query'); + } } =head2 take_action