Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
ac653a6c
Commit
ac653a6c
authored
Oct 19, 2001
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge arjen@work.mysql.com:/home/bk/mysql-4.0
into co3064164-a.rochd1.qld.optushome.com.au:c:/home/mysql-4.0
parents
973d258c
6187a2a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
0 deletions
+81
-0
Docs/Support/update-reserved-words.pl
Docs/Support/update-reserved-words.pl
+81
-0
No files found.
Docs/Support/update-reserved-words.pl
0 → 100755
View file @
ac653a6c
#!/usr/bin/perl
print
STDERR
"
Scanning lex.h for symbols..
\n
";
open
LEX
,
"
<../sql/lex.h
";
while
(
$line
=
<
LEX
>
)
{
if
(
$line
=~
/\{\s+\"([A-Z_]+)\",\s+SYM\(([A-Z_]+)\)/
)
{
$words
{
$2
}
=
$1
;
}
elsif
(
$line
=~
/sql_functions/
)
{
last
;
};
};
close
LEX
;
print
STDERR
"
Scanning sql_yacc.yy for non-reserved words...
\n
";
open
YACC
,
"
<../sql/sql_yacc.yy
";
while
(
<
YACC
>
!~
/^keyword:/
)
{};
while
((
$line
=
<
YACC
>
)
=~
/[\s|]+([A-Z_]+)/
)
{
delete
$words
{
$1
};
};
close
YACC
;
$list
=
sprintf
("
\
@c
Reserved word list updated %s by %s.
\n
"
.
"
\
@c
To regenerate, use Support/update-reserved-words.pl.
\n\n
",
&
pretty_date
,
$ENV
{
USER
});
print
STDERR
"
Copying reserved words to an array...
\n
";
foreach
(
keys
%
words
)
{
push
@words
,
$words
{
$_
};
};
print
STDERR
"
Sorting array...
\n
";
@words
=
sort
@words
;
printf
STDERR
"
There are %i reserved words.
\n
",
scalar
@words
;
@pre
=
("
\
@item
",
"
\
@tab
",
"
\
@tab
",
"
\
@tab
");
@post
=
("",
"
\n
",
"",
"
\n
");
for
(
$i
=
0
;
$word
=
shift
(
@words
);
$i
++
)
{
$list
.=
sprintf
"
%s %-30s %s
",
$pre
[
$i
%
4
],
"
\
@code
\
{
$word
\
}
",
$post
[
$i
%
4
];
};
$list
.=
"
\n
";
open
OLD
,
"
<manual.texi
";
open
NEW
,
"
>manual-tmp.texi
";
print
STDERR
"
Copying beginning of manual.texi...
\n
";
while
((
$line
=
<
OLD
>
)
!~
/START_OF_RESERVED_WORDS/
)
{
print
NEW
$line
;
};
print
NEW
"
\
@c
START_OF_RESERVED_WORDS
\n\n
";
print
STDERR
"
Inserting list of reserved words...
\n
";
print
NEW
"
\
@multitable
\
@columnfractions
.25 .25 .25 .25
\n
";
print
NEW
$list
;
print
NEW
"
\
@end
multitable
\n
";
print
STDERR
"
Skipping over old list...
\n
";
while
((
$line
=
<
OLD
>
)
!~
/END_OF_RESERVED_WORDS/
)
{};
print
NEW
"
\n
\
@c
END_OF_RESERVED_WORDS
\n
";
print
STDERR
"
Copying end of manual.texi...
\n
";
while
(
$line
=
<
OLD
>
)
{
print
NEW
$line
;
};
close
OLD
;
close
NEW
;
print
STDERR
"
Moving manual-tmp.texi to manual.texi...
\n
";
unlink
"
manual.texi
";
rename
"
manual-tmp.texi
",
"
manual.texi
";
print
STDERR
"
Reserved word list updated successfully!
\n
";
sub
pretty_date
{
@time
=
(
$time
=
shift
)?((
localtime
(
$time
))[
0
..
6
]):((
localtime
)[
0
..
6
]);
(
$sec
,
$min
,
$hour
,
$mday
,
$mon
,
$year
,
$wday
)
=
@time
;
$wday
=
(
Sun
,
Mon
,
Tue
,
Wed
,
Thu
,
Fri
,
Sat
)[
$wday
];
$mon
=
(
Jan
,
Feb
,
Mar
,
Apr
,
May
,
Jun
,
Jul
,
Aug
,
Sep
,
Oct
,
Nov
,
Dec
)[
$mon
];
$year
+=
1900
;
$pretty
=
sprintf
("
%s %s %2i %02i:%02i:%02i %i
",
$wday
,
$mon
,
$mday
,
$hour
,
$min
,
$sec
,
$year
);
return
$pretty
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment