Skip to content

Commit

Permalink
Fixed CORE-1837 : Procedure text is stored truncated in system tables…
Browse files Browse the repository at this point in the history
… if any variable have default value
  • Loading branch information
hvlad committed Apr 15, 2008
1 parent 00aeec7 commit a8a0a39
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
8 changes: 7 additions & 1 deletion src/dsql/Parser.h
Expand Up @@ -26,6 +26,7 @@
#include "../jrd/common.h"
#include "../dsql/dsql.h"
#include "../dsql/node.h"
#include "../common/classes/stack.h"

namespace Jrd {

Expand Down Expand Up @@ -65,7 +66,12 @@ class Parser : public Firebird::PermanentStorage
int dsql_debug;

// Actual lexer state begins from here
const TEXT* beginning;

// hvlad: if at some day 16 levels of nesting would be not enough
// then someone must add LexerState constructor and pass memory
// pool into Stack's constructor or change Capacity value in template
// instantiation below
Firebird::Stack<const TEXT*> beginnings;
const TEXT* ptr;
const TEXT* end;
const TEXT* last_token;
Expand Down
18 changes: 11 additions & 7 deletions src/dsql/parse.y
Expand Up @@ -2060,22 +2060,26 @@ alter_view_clause : symbol_view_name column_parens_opt AS begin_string select_ex
/* these rules will capture the input string for storage in metadata */

begin_string :
{ lex.beginning = lex_position(); }
{ lex.beginnings.push(lex_position()); }
;
/*
end_string :
{ $$ = (dsql_nod*) MAKE_string(lex.beginning,
(lex_position() == lex.end) ?
lex_position() - lex.beginning : lex.last_token - lex.beginning);}
{
const TEXT* start = lex.beginnings.pop();
$$ = (dsql_nod*) MAKE_string(start,
(lex_position() == lex.end) ? lex_position() - start : lex.last_token - start);
}
;
*/
begin_trigger :
{ lex.beginning = lex.last_token; }
{ lex.beginnings.push(lex.last_token); }
;

end_trigger :
{ $$ = (dsql_nod*) MAKE_string(lex.beginning,
lex_position() - lex.beginning); }
{
const TEXT* start = lex.beginnings.pop();
$$ = (dsql_nod*) MAKE_string(start, lex_position() - start);
}
;


Expand Down

0 comments on commit a8a0a39

Please sign in to comment.