Skip to content

Commit

Permalink
Patch for invalid SQL in Postgres.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Thoma authored and lge committed Oct 22, 2010
1 parent f1c1566 commit 448e725
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion check.c
Expand Up @@ -210,7 +210,7 @@ void csync_check_del(const char *file, int recursive, int init_run)

if ( recursive ) {
if ( !strcmp(file, "/") )
ASPRINTF(&where_rec, "or 1")
ASPRINTF(&where_rec, "")
else
ASPRINTF(&where_rec, "UNION ALL SELECT filename from file where filename > '%s/' "
"and filename < '%s0'",
Expand Down
56 changes: 56 additions & 0 deletions csync2-postgres.sql
@@ -0,0 +1,56 @@
--
-- Table structure for table action
--

DROP TABLE IF EXISTS action;
CREATE TABLE action (
filename varchar(255) DEFAULT NULL,
command text,
logfile text,
UNIQUE (filename,command)
);

--
-- Table structure for table dirty
--

DROP TABLE IF EXISTS dirty;
CREATE TABLE dirty (
filename varchar(200) DEFAULT NULL,
forced int DEFAULT NULL,
myname varchar(100) DEFAULT NULL,
peername varchar(100) DEFAULT NULL,
UNIQUE (filename,peername)
);

--
-- Table structure for table file
--

DROP TABLE IF EXISTS file;
CREATE TABLE file (
filename varchar(200) DEFAULT NULL,
checktxt varchar(200) DEFAULT NULL,
UNIQUE (filename)
);

--
-- Table structure for table hint
--

DROP TABLE IF EXISTS hint;
CREATE TABLE hint (
filename varchar(255) DEFAULT NULL,
recursive int DEFAULT NULL
);

--
-- Table structure for table x509_cert
--

DROP TABLE IF EXISTS x509_cert;
CREATE TABLE x509_cert (
peername varchar(255) DEFAULT NULL,
certdata varchar(255) DEFAULT NULL,
UNIQUE (peername)
);

0 comments on commit 448e725

Please sign in to comment.