summaryrefslogtreecommitdiff
path: root/src/backend/regex/regcomp.c
diff options
context:
space:
mode:
authorThomas G. Lockhart2002-06-11 15:44:38 +0000
committerThomas G. Lockhart2002-06-11 15:44:38 +0000
commitea01a451ccec55cada68cb45a54519a750fd3d60 (patch)
treee6f38191dbf7383eaf35f41009b37a13b2ce1fe7 /src/backend/regex/regcomp.c
parent090dd22de67e6a7e50cfc3efb92a8472fa8750ba (diff)
Implement SQL99 OVERLAY(). Allows substitution of a substring in a string.
Implement SQL99 SIMILAR TO as a synonym for our existing operator "~". Implement SQL99 regular expression SUBSTRING(string FROM pat FOR escape). Extend the definition to make the FOR clause optional. Define textregexsubstr() to actually implement this feature. Update the regression test to include these new string features. All tests pass. Rename the regular expression support routines from "pg95_xxx" to "pg_xxx". Define CREATE CHARACTER SET in the parser per SQL99. No implementation yet.
Diffstat (limited to 'src/backend/regex/regcomp.c')
-rw-r--r--src/backend/regex/regcomp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/regex/regcomp.c b/src/backend/regex/regcomp.c
index bea464bd2ae..d6f7b26fa1a 100644
--- a/src/backend/regex/regcomp.c
+++ b/src/backend/regex/regcomp.c
@@ -174,9 +174,10 @@ static int never = 0; /* for use in asserts; shuts lint up */
/*
* regcomp - interface for parser and compilation
+ * returns 0 success, otherwise REG_something
*/
-int /* 0 success, otherwise REG_something */
-pg95_regcomp(regex_t *preg, const char *pattern, int cflags)
+int
+pg_regcomp(regex_t *preg, const char *pattern, int cflags)
{
struct parse pa;
struct re_guts *g;
@@ -224,7 +225,6 @@ pg95_regcomp(regex_t *preg, const char *pattern, int cflags)
(void) pg_mb2wchar((unsigned char *) pattern, wcp);
len = pg_wchar_strlen(wcp);
#else
-
len = strlen((char *) pattern);
#endif
}
@@ -305,7 +305,7 @@ pg95_regcomp(regex_t *preg, const char *pattern, int cflags)
/* win or lose, we're done */
if (p->error != 0) /* lose */
- pg95_regfree(preg);
+ pg_regfree(preg);
return p->error;
}