Per bug #49 - reported by Richard Yen <dba@richyen.com>
authorChristopher Browne <cbbrowne@ca.afilias.info>
Tue, 13 May 2008 21:41:59 +0000 (21:41 +0000)
committerChristopher Browne <cbbrowne@ca.afilias.info>
Tue, 13 May 2008 21:41:59 +0000 (21:41 +0000)
Seems like double single-quotes and slashes are begin converted to single
single-quotes and slashes when not desired:

ERROR 2008-04-24 16:17:32 > PGRES_FATAL_ERROR: ERROR:  syntax error at or near
"Cahier"
LINE 1: ..._count, compare_to_database) values ('1969048', ''Cahier d'u...
                                                            ^
Query was: insert into "public"."m_object_paper" (id, title, x_firstname,
x_lastname, char_length, word_count, grade, grade_note, overwriteflag,
is_indexed, folder, "assignment", "owner", node, page_count,
compare_to_database) values ('1969048', ''Cahier d'un retour au pays natal' is
prinicpally defined by violence. Discuss', 'Charlotte', 'Byrne', '10937',
'1689', NULL, NULL, 't', 'f', '0', '88981', '445800', '2', NULL,
'1000100000000000000000100000000000101');
WARN  2008-04-24 16:17:32 > waiting for resume

My fix for this was in scan.l:175
+                            *cp++ = c;
                             *cp++ = c;
+                           len += 2;
-                           len++;

Similar changes at lines 191, 244, and 260

src/slony_logshipper/scan.l

index a4ec74e75b1b10f456a48d3db26397fb58d29c4c..89a4922dff654540d06c0169abb3a5cefca479ac 100755 (executable)
@@ -7,7 +7,7 @@
  *     Copyright (c) 2003-2004, PostgreSQL Global Development Group
  *     Author: Jan Wieck, Afilias USA INC.
  *
- *     $Id: scan.l,v 1.2 2007-09-09 02:37:05 wieck Exp $
+ *     $Id: scan.l,v 1.3 2008-05-13 21:41:59 cbbrowne Exp $
  *-------------------------------------------------------------------------
  */
 
@@ -175,7 +175,7 @@ setval                                      { return T_PGSETVAL_FUNCTION;   }
                                                                break;
                                                        }
                                                        *cp++ = c;
-                                                       len++;
+                                                       len+=2;
                                                        continue;
                                                }
                                                if (c == '\'')
@@ -191,7 +191,7 @@ setval                                      { return T_PGSETVAL_FUNCTION;   }
                                                        if (c == '\'')
                                                        {
                                                                *cp++ = c;
-                                                               len++;
+                                                               len+=2;
                                                                continue;
                                                        }
                                                        unput(c);
@@ -244,7 +244,7 @@ setval                                      { return T_PGSETVAL_FUNCTION;   }
                                                                break;
                                                        }
                                                        *cp++ = c;
-                                                       len++;
+                                                       len+=2;
                                                        continue;
                                                }
                                                if (c == '\'')
@@ -260,7 +260,7 @@ setval                                      { return T_PGSETVAL_FUNCTION;   }
                                                        if (c == '\'')
                                                        {
                                                                *cp++ = c;
-                                                               len++;
+                                                               len+=2;
                                                                continue;
                                                        }
                                                        unput(c);