summaryrefslogtreecommitdiff
path: root/regex
diff options
context:
space:
mode:
authorunknown <monty@tramp.mysql.fi>2000-10-03 14:18:03 +0300
committerunknown <monty@tramp.mysql.fi>2000-10-03 14:18:03 +0300
commit63b7b45ff7f79a08a673e8b759a69f5ee7e67902 (patch)
treec02cc6a9c6585038615c596332aae70354b44aac /regex
parent27a17a6ef909533820b2137ab598fb7df220876d (diff)
downloadmariadb-git-63b7b45ff7f79a08a673e8b759a69f5ee7e67902.tar.gz
First part of automatic repair of MyISAM tables.
Error on full disk on repair. SIGHUP signal handling. Update with keys on timestamp Portability fixes Docs/manual.texi: Added documentation about automatic repair of MyISAM tables client/mysql.cc: Remove usage of tempnam. include/my_sys.h: Added create_temp_file include/myisam.h: Fix for disk full on repair myisam/mi_check.c: Fix for disk full on repair myisam/sort.c: Fix for disk full on repair & removed usage of tempnam() mysys/mf_cache.c: Remove usage of tempnam() mysys/mf_dirname.c: Changed convert_dirname to return end 0 mysys/my_fopen.c: Security fixes mysys/my_tempnam.c: remove blanks readline/bind.c: Portability fixes readline/complete.c: Portability fixes readline/histexpand.c: Portability fixes readline/input.c: Portability fixes readline/search.c: Portability fixes readline/shell.c: Portability fixes readline/terminal.c: Portability fixes readline/tilde.c: Portability fixes readline/undo.c: Portability fixes regex/cname.h: Portability fixes regex/debug.c: Portability fixes regex/main.c: Portability fixes regex/regcomp.c: Portability fixes regex/regerror.c: Portability fixes sql/filesort.cc: Remove dummy code sql/ha_myisam.cc: Automatic repair of MyISAM tables sql/ha_myisam.h: Automatic repair of MyISAM tables sql/handler.cc: Automatic repair of MyISAM tables sql/handler.h: Automatic repair of MyISAM tables sql/key.cc: Fix for UPDATE with key on timestamp column sql/mysql_priv.h: Automatic repair of MyISAM tables sql/mysqld.cc: Automatic repair of MyISAM tables & signal SIGHUP handling sql/sql_base.cc: Automatic repair of MyISAM tables sql/sql_class.cc: Automatic repair of MyISAM tables sql/sql_class.h: Fix for insert with reference to columns sql/sql_insert.cc: Fix for insert with reference to columns sql/table.cc: Automatic repair of MyISAM tables BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'regex')
-rw-r--r--regex/cname.h194
-rw-r--r--regex/debug.c2
-rw-r--r--regex/main.c2
-rw-r--r--regex/regcomp.c56
-rw-r--r--regex/regerror.c34
5 files changed, 145 insertions, 143 deletions
diff --git a/regex/cname.h b/regex/cname.h
index 02e86e912e3..2b6a1a8496f 100644
--- a/regex/cname.h
+++ b/regex/cname.h
@@ -3,100 +3,102 @@ static struct cname {
char *name;
char code;
} cnames[] = {
- "NUL", '\0',
- "SOH", '\001',
- "STX", '\002',
- "ETX", '\003',
- "EOT", '\004',
- "ENQ", '\005',
- "ACK", '\006',
- "BEL", '\007',
- "alert", '\007',
- "BS", '\010',
- "backspace", '\b',
- "HT", '\011',
- "tab", '\t',
- "LF", '\012',
- "newline", '\n',
- "VT", '\013',
- "vertical-tab", '\v',
- "FF", '\014',
- "form-feed", '\f',
- "CR", '\015',
- "carriage-return", '\r',
- "SO", '\016',
- "SI", '\017',
- "DLE", '\020',
- "DC1", '\021',
- "DC2", '\022',
- "DC3", '\023',
- "DC4", '\024',
- "NAK", '\025',
- "SYN", '\026',
- "ETB", '\027',
- "CAN", '\030',
- "EM", '\031',
- "SUB", '\032',
- "ESC", '\033',
- "IS4", '\034',
- "FS", '\034',
- "IS3", '\035',
- "GS", '\035',
- "IS2", '\036',
- "RS", '\036',
- "IS1", '\037',
- "US", '\037',
- "space", ' ',
- "exclamation-mark", '!',
- "quotation-mark", '"',
- "number-sign", '#',
- "dollar-sign", '$',
- "percent-sign", '%',
- "ampersand", '&',
- "apostrophe", '\'',
- "left-parenthesis", '(',
- "right-parenthesis", ')',
- "asterisk", '*',
- "plus-sign", '+',
- "comma", ',',
- "hyphen", '-',
- "hyphen-minus", '-',
- "period", '.',
- "full-stop", '.',
- "slash", '/',
- "solidus", '/',
- "zero", '0',
- "one", '1',
- "two", '2',
- "three", '3',
- "four", '4',
- "five", '5',
- "six", '6',
- "seven", '7',
- "eight", '8',
- "nine", '9',
- "colon", ':',
- "semicolon", ';',
- "less-than-sign", '<',
- "equals-sign", '=',
- "greater-than-sign", '>',
- "question-mark", '?',
- "commercial-at", '@',
- "left-square-bracket", '[',
- "backslash", '\\',
- "reverse-solidus", '\\',
- "right-square-bracket", ']',
- "circumflex", '^',
- "circumflex-accent", '^',
- "underscore", '_',
- "low-line", '_',
- "grave-accent", '`',
- "left-brace", '{',
- "left-curly-bracket", '{',
- "vertical-line", '|',
- "right-brace", '}',
- "right-curly-bracket", '}',
- "tilde", '~',
- "DEL", '\177',
- NULL, 0,
+ {"NUL", '\0'},
+ {"SOH", '\001'},
+ {"STX", '\002'},
+ {"ETX", '\003'},
+ {"EOT", '\004'},
+ {"ENQ", '\005'},
+ {"ACK", '\006'},
+ {"BEL", '\007'},
+ {"alert", '\007'},
+ {"BS", '\010'},
+ {"backspace", '\b'},
+ {"HT", '\011'},
+ {"tab", '\t'},
+ {"LF", '\012'},
+ {"newline", '\n'},
+ {"VT", '\013'},
+ {"vertical-tab",'\v'},
+ {"FF", '\014'},
+ {"form-feed", '\f'},
+ {"CR", '\015'},
+ {"carriage-return", '\r'},
+ {"SO", '\016'},
+ {"SI", '\017'},
+ {"DLE", '\020'},
+ {"DC1", '\021'},
+ {"DC2", '\022'},
+ {"DC3", '\023'},
+ {"DC4", '\024'},
+ {"NAK", '\025'},
+ {"SYN", '\026'},
+ {"ETB", '\027'},
+ {"CAN", '\030'},
+ {"EM", '\031'},
+ {"SUB", '\032'},
+ {"ESC", '\033'},
+ {"IS4", '\034'},
+ {"FS", '\034'},
+ {"IS3", '\035'},
+ {"GS", '\035'},
+ {"IS2", '\036'},
+ {"RS", '\036'},
+ {"IS1", '\037'},
+ {"US", '\037'},
+ {"space", ' '},
+ {"exclamation-mark", '!'},
+ {"quotation-mark", '"'},
+ {"number-sign", '#'},
+ {"dollar-sign", '$'},
+ {"percent-sign", '%'},
+ {"ampersand", '&'},
+ {"apostrophe", '\''},
+ {"left-parenthesis", '('},
+ {"right-parenthesis", ')'},
+ {"asterisk", '*'},
+ {"plus-sign", '+'},
+ {"comma", ','},
+ {"hyphen", '-'},
+ {"hyphen-minus", '-'},
+ {"period", '.'},
+ {"full-stop", '.'},
+ {"slash", '/'},
+ {"solidus", '/'},
+ {"zero", '0'},
+ {"one", '1'},
+ {"two", '2'},
+ {"three", '3'},
+ {"four", '4'},
+ {"five", '5'},
+ {"six", '6'},
+ {"seven", '7'},
+ {"eight", '8'},
+ {"nine", '9'},
+ {"colon", ':'},
+ {"semicolon", ';'},
+ {"less-than-sign", '<'},
+ {"equals-sign", '='},
+ {"greater-than-sign", '>'},
+ {"question-mark", '?'},
+ {"commercial-at", '@'},
+ {"left-square-bracket", '['},
+ {"backslash", '\\'},
+ {"reverse-solidus", '\\'},
+ {"right-square-bracket",']'},
+ {"circumflex", '^'},
+ {"circumflex-accent", '^'},
+ {"underscore", '_'},
+ {"low-line", '_'},
+ {"grave-accent", '`'},
+ {"left-brace", '{'},
+ {"left-curly-bracket", '{'},
+ {"vertical-line", '|'},
+ {"right-brace", '}'},
+ {"right-curly-bracket", '}'},
+ {"tilde", '~'},
+ {"DEL", '\177'},
+ {NULL, 0},
};
+
+
diff --git a/regex/debug.c b/regex/debug.c
index 145a9736d39..8c6fd14a209 100644
--- a/regex/debug.c
+++ b/regex/debug.c
@@ -217,7 +217,7 @@ FILE *d;
fprintf(d, ">");
break;
default:
- fprintf(d, "!%d(%d)!", OP(*s), opnd);
+ fprintf(d, "!%ld(%ld)!", OP(*s), opnd);
break;
}
if (!done)
diff --git a/regex/main.c b/regex/main.c
index beed2738b1d..4b607f401ca 100644
--- a/regex/main.c
+++ b/regex/main.c
@@ -103,7 +103,7 @@ char *argv[];
len = (int)(subs[0].rm_eo - subs[0].rm_so);
if (subs[0].rm_so != -1) {
if (len != 0)
- printf("match `%.*s'\n", len,
+ printf("match `%.*s'\n", (int)len,
argv[optind] + subs[0].rm_so);
else
printf("match `'@%.1s\n",
diff --git a/regex/regcomp.c b/regex/regcomp.c
index 885c6a7cbc8..048f45ca71c 100644
--- a/regex/regcomp.c
+++ b/regex/regcomp.c
@@ -219,7 +219,7 @@ int stop; /* character this ERE should end at */
conc = HERE();
while (MORE() && (c = PEEK()) != '|' && c != stop)
p_ere_exp(p);
- REQUIRE(HERE() != conc, REG_EMPTY); /* require nonempty */
+ if(REQUIRE(HERE() != conc, REG_EMPTY)); /* require nonempty */
if (!EAT('|'))
break; /* NOTE BREAK OUT */
@@ -266,7 +266,7 @@ register struct parse *p;
pos = HERE();
switch (c) {
case '(':
- REQUIRE(MORE(), REG_EPAREN);
+ if(REQUIRE(MORE(), REG_EPAREN));
p->g->nsub++;
subno = (sopno) p->g->nsub;
if (subno < NPAREN)
@@ -279,7 +279,7 @@ register struct parse *p;
assert(p->pend[subno] != 0);
}
EMIT(ORPAREN, subno);
- MUSTEAT(')', REG_EPAREN);
+ if(MUSTEAT(')', REG_EPAREN));
break;
#ifndef POSIX_MISTAKE
case ')': /* happens only if no current unmatched ( */
@@ -322,12 +322,12 @@ register struct parse *p;
p_bracket(p);
break;
case '\\':
- REQUIRE(MORE(), REG_EESCAPE);
+ if(REQUIRE(MORE(), REG_EESCAPE));
c = GETNEXT();
ordinary(p, c);
break;
case '{': /* okay as ordinary except if digit follows */
- REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT);
+ if(REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT));
/* FALLTHROUGH */
default:
ordinary(p, c);
@@ -343,7 +343,7 @@ register struct parse *p;
return; /* no repetition, we're done */
NEXT();
- REQUIRE(!wascaret, REG_BADRPT);
+ if(REQUIRE(!wascaret, REG_BADRPT));
switch (c) {
case '*': /* implemented as +? */
/* this case does not require the (y|) trick, noKLUDGE */
@@ -370,7 +370,7 @@ register struct parse *p;
if (EAT(',')) {
if (isdigit(PEEK())) {
count2 = p_count(p);
- REQUIRE(count <= count2, REG_BADBR);
+ if(REQUIRE(count <= count2, REG_BADBR));
} else /* single number with comma */
count2 = RE_INFINITY;
} else /* just a single number */
@@ -379,7 +379,7 @@ register struct parse *p;
if (!EAT('}')) { /* error heuristics */
while (MORE() && PEEK() != '}')
NEXT();
- REQUIRE(MORE(), REG_EBRACE);
+ if(REQUIRE(MORE(), REG_EBRACE));
SETERROR(REG_BADBR);
}
break;
@@ -402,7 +402,7 @@ static void
p_str(p)
register struct parse *p;
{
- REQUIRE(MORE(), REG_EMPTY);
+ if(REQUIRE(MORE(), REG_EMPTY));
while (MORE())
ordinary(p, GETNEXT());
}
@@ -445,7 +445,7 @@ register int end2; /* second terminating character */
p->g->neol++;
}
- REQUIRE(HERE() != start, REG_EMPTY); /* require nonempty */
+ if(REQUIRE(HERE() != start, REG_EMPTY)); /* require nonempty */
}
/*
@@ -470,7 +470,7 @@ int starordinary; /* is a leading * an ordinary character? */
assert(MORE()); /* caller should have ensured this */
c = GETNEXT();
if (c == '\\') {
- REQUIRE(MORE(), REG_EESCAPE);
+ if(REQUIRE(MORE(), REG_EESCAPE));
c = BACKSL | (unsigned char)GETNEXT();
}
switch (c) {
@@ -500,7 +500,7 @@ int starordinary; /* is a leading * an ordinary character? */
assert(p->pend[subno] != 0);
}
EMIT(ORPAREN, subno);
- REQUIRE(EATTWO('\\', ')'), REG_EPAREN);
+ if(REQUIRE(EATTWO('\\', ')'), REG_EPAREN));
break;
case BACKSL|')': /* should not get here -- must be user */
case BACKSL|'}':
@@ -530,7 +530,7 @@ int starordinary; /* is a leading * an ordinary character? */
p->g->backrefs = 1;
break;
case '*':
- REQUIRE(starordinary, REG_BADRPT);
+ if(REQUIRE(starordinary, REG_BADRPT));
/* FALLTHROUGH */
default:
ordinary(p, c &~ BACKSL);
@@ -548,7 +548,7 @@ int starordinary; /* is a leading * an ordinary character? */
if (EAT(',')) {
if (MORE() && isdigit(PEEK())) {
count2 = p_count(p);
- REQUIRE(count <= count2, REG_BADBR);
+ if(REQUIRE(count <= count2, REG_BADBR));
} else /* single number with comma */
count2 = RE_INFINITY;
} else /* just a single number */
@@ -557,7 +557,7 @@ int starordinary; /* is a leading * an ordinary character? */
if (!EATTWO('\\', '}')) { /* error heuristics */
while (MORE() && !SEETWO('\\', '}'))
NEXT();
- REQUIRE(MORE(), REG_EBRACE);
+ if(REQUIRE(MORE(), REG_EBRACE));
SETERROR(REG_BADBR);
}
} else if (c == (unsigned char)'$') /* $ (but not \$) ends it */
@@ -582,7 +582,7 @@ register struct parse *p;
ndigits++;
}
- REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR);
+ if(REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR));
return(count);
}
@@ -622,7 +622,7 @@ register struct parse *p;
p_b_term(p, cs);
if (EAT('-'))
CHadd(cs, '-');
- MUSTEAT(']', REG_EBRACK);
+ if(MUSTEAT(']', REG_EBRACK));
if (p->error != 0) /* don't mess things up further */
return;
@@ -693,21 +693,21 @@ register cset *cs;
switch (c) {
case ':': /* character class */
NEXT2();
- REQUIRE(MORE(), REG_EBRACK);
+ if(REQUIRE(MORE(), REG_EBRACK));
c = PEEK();
- REQUIRE(c != '-' && c != ']', REG_ECTYPE);
+ if(REQUIRE(c != '-' && c != ']', REG_ECTYPE));
p_b_cclass(p, cs);
- REQUIRE(MORE(), REG_EBRACK);
- REQUIRE(EATTWO(':', ']'), REG_ECTYPE);
+ if(REQUIRE(MORE(), REG_EBRACK));
+ if(REQUIRE(EATTWO(':', ']'), REG_ECTYPE));
break;
case '=': /* equivalence class */
NEXT2();
- REQUIRE(MORE(), REG_EBRACK);
+ if(REQUIRE(MORE(), REG_EBRACK));
c = PEEK();
- REQUIRE(c != '-' && c != ']', REG_ECOLLATE);
+ if(REQUIRE(c != '-' && c != ']', REG_ECOLLATE));
p_b_eclass(p, cs);
- REQUIRE(MORE(), REG_EBRACK);
- REQUIRE(EATTWO('=', ']'), REG_ECOLLATE);
+ if(REQUIRE(MORE(), REG_EBRACK));
+ if(REQUIRE(EATTWO('=', ']'), REG_ECOLLATE));
break;
default: /* symbol, ordinary character, or range */
/* xxx revision needed for multichar stuff */
@@ -722,7 +722,7 @@ register cset *cs;
} else
finish = start;
/* xxx what about signed chars here... */
- REQUIRE(start <= finish, REG_ERANGE);
+ if(REQUIRE(start <= finish, REG_ERANGE));
for (i = start; i <= finish; i++)
CHadd(cs, i);
break;
@@ -790,13 +790,13 @@ register struct parse *p;
{
register char value;
- REQUIRE(MORE(), REG_EBRACK);
+ if(REQUIRE(MORE(), REG_EBRACK));
if (!EATTWO('[', '.'))
return(GETNEXT());
/* collating symbol */
value = p_b_coll_elem(p, '.');
- REQUIRE(EATTWO('.', ']'), REG_ECOLLATE);
+ if(REQUIRE(EATTWO('.', ']'), REG_ECOLLATE));
return(value);
}
diff --git a/regex/regerror.c b/regex/regerror.c
index 4810db23f12..a356912564a 100644
--- a/regex/regerror.c
+++ b/regex/regerror.c
@@ -31,23 +31,23 @@ static struct rerr {
char *name;
char *explain;
} rerrs[] = {
- REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match",
- REG_BADPAT, "REG_BADPAT", "invalid regular expression",
- REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element",
- REG_ECTYPE, "REG_ECTYPE", "invalid character class",
- REG_EESCAPE, "REG_EESCAPE", "trailing backslash (\\)",
- REG_ESUBREG, "REG_ESUBREG", "invalid backreference number",
- REG_EBRACK, "REG_EBRACK", "brackets ([ ]) not balanced",
- REG_EPAREN, "REG_EPAREN", "parentheses not balanced",
- REG_EBRACE, "REG_EBRACE", "braces not balanced",
- REG_BADBR, "REG_BADBR", "invalid repetition count(s)",
- REG_ERANGE, "REG_ERANGE", "invalid character range",
- REG_ESPACE, "REG_ESPACE", "out of memory",
- REG_BADRPT, "REG_BADRPT", "repetition-operator operand invalid",
- REG_EMPTY, "REG_EMPTY", "empty (sub)expression",
- REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug",
- REG_INVARG, "REG_INVARG", "invalid argument to regex routine",
- 0, "", "*** unknown regexp error code ***",
+ {REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match"},
+ {REG_BADPAT, "REG_BADPAT", "invalid regular expression"},
+ {REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element"},
+ {REG_ECTYPE, "REG_ECTYPE", "invalid character class"},
+ {REG_EESCAPE, "REG_EESCAPE", "trailing backslash (\\)"},
+ {REG_ESUBREG, "REG_ESUBREG", "invalid backreference number"},
+ {REG_EBRACK, "REG_EBRACK", "brackets ([ ]) not balanced"},
+ {REG_EPAREN, "REG_EPAREN", "parentheses not balanced"},
+ {REG_EBRACE, "REG_EBRACE", "braces not balanced"},
+ {REG_BADBR, "REG_BADBR", "invalid repetition count(s)"},
+ {REG_ERANGE, "REG_ERANGE", "invalid character range"},
+ {REG_ESPACE, "REG_ESPACE", "out of memory"},
+ {REG_BADRPT, "REG_BADRPT", "repetition-operator operand invalid"},
+ {REG_EMPTY, "REG_EMPTY", "empty (sub)expression"},
+ {REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug"},
+ {REG_INVARG, "REG_INVARG", "invalid argument to regex routine"},
+ {0, "", "*** unknown regexp error code ***"},
};
/*