@@ -2244,10 +2244,24 @@ MtmNoticeReceiver(void *i, const PGresult *res)
22442244
22452245stripped_notice = palloc0 (len );
22462246
2247- /* Strip "NOTICE: " from beginning and "\n" from end of error string */
2248- strncpy (stripped_notice ,notice + 9 ,len - 1 - 9 );
2247+ if (* notice == 'N' )
2248+ {
2249+ /* Strip "NOTICE: " from beginning and "\n" from end of error string */
2250+ strncpy (stripped_notice ,notice + 9 ,len - 1 - 9 );
2251+ elog (NOTICE ,"%s" ,stripped_notice );
2252+ }
2253+ else if (* notice == 'W' )
2254+ {
2255+ /* Strip "WARNING: " from beginning and "\n" from end of error string */
2256+ strncpy (stripped_notice ,notice + 10 ,len - 1 - 10 );
2257+ elog (WARNING ,"%s" ,stripped_notice );
2258+ }
2259+ else
2260+ {
2261+ stripped_notice = notice ;
2262+ elog (WARNING ,"%s" ,stripped_notice );
2263+ }
22492264
2250- MTM_LOG1 ("%s" ,stripped_notice );
22512265pfree (stripped_notice );
22522266}
22532267
@@ -2473,41 +2487,45 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24732487case T_PrepareStmt :
24742488case T_ExecuteStmt :
24752489case T_DeallocateStmt :
2476- //case T_GrantStmt: /* XXX: we could replicate some of these these */;
2477- //case T_GrantRoleStmt:
2478- //case T_AlterDatabaseStmt:
2479- //case T_AlterDatabaseSetStmt:
24802490case T_NotifyStmt :
24812491case T_ListenStmt :
24822492case T_UnlistenStmt :
24832493case T_LoadStmt :
24842494case T_ClusterStmt :/* XXX: we could replicate these */ ;
24852495case T_VacuumStmt :
24862496case T_ExplainStmt :
2487- //case T_AlterSystemStmt:
24882497case T_VariableShowStmt :
2489- case T_DiscardStmt :
2490- //case T_CreateEventTrigStmt:
2491- //case T_AlterEventTrigStmt:
2492- //case T_CreateRoleStmt:
2493- //case T_AlterRoleStmt:
2494- //case T_AlterRoleSetStmt:
2495- //case T_DropRoleStmt:
24962498case T_ReassignOwnedStmt :
24972499case T_LockStmt :
2498- //case T_ConstraintsSetStmt:
24992500case T_CheckPointStmt :
25002501case T_ReindexStmt :
25012502skipCommand = true;
25022503break ;
2504+ case T_DiscardStmt :
2505+ {
2506+ //DiscardStmt *stmt = (DiscardStmt *) parsetree;
2507+ //skipCommand = stmt->target == DISCARD_TEMP;
2508+
2509+ skipCommand = true;
2510+
2511+ if (MtmGUCBufferAllocated )
2512+ {
2513+ // XXX: move allocation somewhere to backend startup and check
2514+ // where buffer is empty in send routines.
2515+ MtmGUCBufferAllocated = false;
2516+ pfree (MtmGUCBuffer );
2517+ }
2518+
2519+ }
2520+ break ;
25032521case T_VariableSetStmt :
25042522{
25052523VariableSetStmt * stmt = (VariableSetStmt * )parsetree ;
25062524
25072525skipCommand = true;
25082526
25092527/* Prevent SET TRANSACTION from replication */
2510- if (MtmTx . isTransactionBlock || stmt -> kind == VAR_SET_MULTI )
2528+ if (stmt -> kind == VAR_SET_MULTI )
25112529break ;
25122530
25132531if (!MtmGUCBufferAllocated )
@@ -2520,13 +2538,10 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
25202538MtmGUCBufferAllocated = true;
25212539}
25222540
2523- //appendStringInfoString(MtmGUCBuffer, "SET ");
2524- //appendStringInfoString(MtmGUCBuffer, stmt->name);
2525- //appendStringInfoString(MtmGUCBuffer, " TO ");
2526- //appendStringInfoString(MtmGUCBuffer, ExtractSetVariableArgs(stmt));
2527- //appendStringInfoString(MtmGUCBuffer, "; ");
2528-
25292541appendStringInfoString (MtmGUCBuffer ,queryString );
2542+
2543+ // sometimes there is no ';' char at the end.
2544+ appendStringInfoString (MtmGUCBuffer ,";" );
25302545}
25312546break ;
25322547case T_CreateStmt :