osync_archive_save_ignored_conflict()

View: New views
8 Messages — Rating Filter:   Alert me  

osync_archive_save_ignored_conflict()

by Chris Frey-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

In the opensync_archive_internals.h header, _save_ignored_conflict()
is documented as such:

/**
 * @brief Saves an entry in the ignored conflict list.
 *
 * @param archive The group archive
 * @param objtype Reported object type of entry
 * @param mappingid Mapping Entry ID of entry
 * @param changetype Changetype of entry
 * @param error Pointer to an error struct
 * @return Returns TRUE on success, FALSE otherwise
 */
osync_bool osync_archive_save_ignored_conflict(OSyncArchive *archive, const char *objtype, long long int mappingid, OSyncChangeType changetype, OSyncError **error);


In opensync_archive.c, it is implemented like this:

osync_bool osync_archive_save_ignored_conflict(OSyncArchive *archive, const char *objtype, long long int id, OSyncChangeType changetype, OSyncError **error)
{
[...]

        query = osync_strdup_printf("INSERT INTO tbl_changelog (objtype, entryid, changetype) VALUES('%s', '%lli', '%i')", escaped_objtype, id, changetype);

...


Isn't the entryid field used for the archive id's themselves, and not the
mapping ids?

Thanks,
- Chris




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

Re: osync_archive_save_ignored_conflict()

by Daniel Gollub-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Saturday 07 November 2009 12:58:38 am Chris Frey wrote:

> Hi,
>
> In the opensync_archive_internals.h header, _save_ignored_conflict()
> is documented as such:
>
> /**
>  * @brief Saves an entry in the ignored conflict list.
>  *
>  * @param archive The group archive
>  * @param objtype Reported object type of entry
>  * @param mappingid Mapping Entry ID of entry
That's correct.

>  * @param changetype Changetype of entry
>  * @param error Pointer to an error struct
>  * @return Returns TRUE on success, FALSE otherwise
>  */
> osync_bool osync_archive_save_ignored_conflict(OSyncArchive *archive, const
>  char *objtype, long long int mappingid, OSyncChangeType changetype,
>  OSyncError **error);
>
>
> In opensync_archive.c, it is implemented like this:
>
> osync_bool osync_archive_save_ignored_conflict(OSyncArchive *archive, const
>  char *objtype, long long int id, OSyncChangeType changetype, OSyncError
>  **error) {
> [...]
maybe we should sync this up with the other declaration and call it "mappingid".

>
>         query = osync_strdup_printf("INSERT INTO tbl_changelog (objtype,
>  entryid, changetype) VALUES('%s', '%lli', '%i')", escaped_objtype, id,
>  changetype);

The tbl_changelog is indeed very confusing. There is one column left-over we
doesn't us at all: "id"

And the "entryid" is also very confusing.

>
> ...
>
>
> Isn't the entryid field used for the archive id's themselves, and not the
> mapping ids?

Not quite sure which ID you mean for "archive id".

FYI, the tbl_changelog is only used for handling "ignored" conflicts ...
tbl_changes is used to store the "mappings".
tbl_archive stores only the entire entries of a change when merger/demerge
gets used.


While looking into this i found a bug in OpenSync which broke the support
of "ignore conflicts". Which is hopefully fixed now with r5950


Here is a dump of the tbl_changes and tbl_changelog, which contains two
conflicts which got ignored. (I used for that a group with two file-sync members)

----8<----
BEGIN TRANSACTION;
CREATE TABLE tbl_changes (objtype VARCHAR(64) NOT NULL, id INTEGER PRIMARY KEY AUTOINCREMENT, uid VARCHAR NOT NULL, memberid INTEGER NOT NULL, mappingid INTEGER NOT NULL,
objengine VARCHAR(64) NOT NULL );
INSERT INTO "tbl_changes" VALUES('contact',67,'foo0',2,1,'contact');
INSERT INTO "tbl_changes" VALUES('contact',68,'foo3',2,2,'contact');
INSERT INTO "tbl_changes" VALUES('contact',69,'foo1',2,3,'contact');
INSERT INTO "tbl_changes" VALUES('contact',70,'test1.vcard',2,4,'contact');
INSERT INTO "tbl_changes" VALUES('contact',71,'foo5',2,5,'contact');
INSERT INTO "tbl_changes" VALUES('contact',72,'foo8',2,6,'contact');
INSERT INTO "tbl_changes" VALUES('contact',73,'foo4',2,7,'contact');
INSERT INTO "tbl_changes" VALUES('contact',74,'foo2',2,8,'contact');
INSERT INTO "tbl_changes" VALUES('contact',75,'foo6',2,9,'contact');
INSERT INTO "tbl_changes" VALUES('contact',76,'foo7',2,10,'contact');
INSERT INTO "tbl_changes" VALUES('contact',77,'foo9',2,11,'contact');
INSERT INTO "tbl_changes" VALUES('contact',78,'foo0',1,1,'contact');
INSERT INTO "tbl_changes" VALUES('contact',79,'foo3',1,2,'contact');
INSERT INTO "tbl_changes" VALUES('contact',80,'foo1',1,3,'contact');
INSERT INTO "tbl_changes" VALUES('contact',81,'test1.vcard',1,4,'contact');
INSERT INTO "tbl_changes" VALUES('contact',82,'foo5',1,5,'contact');
INSERT INTO "tbl_changes" VALUES('contact',84,'foo4',1,7,'contact');
INSERT INTO "tbl_changes" VALUES('contact',85,'foo2',1,8,'contact');
INSERT INTO "tbl_changes" VALUES('contact',86,'foo6',1,9,'contact');
INSERT INTO "tbl_changes" VALUES('contact',87,'foo7',1,10,'contact');
INSERT INTO "tbl_changes" VALUES('contact',88,'foo9',1,11,'contact');
COMMIT;
dgollub@marvin:~> sqlite3 .config/opensync/0.40/group1/archive.db ".dump tbl_changelog"
BEGIN TRANSACTION;
CREATE TABLE tbl_changelog (objtype VARCHAR(64), id INTEGER, entryid INTEGER, changetype INTEGER, PRIMARY KEY (objtype, id) );
INSERT INTO "tbl_changelog" VALUES('contact',NULL,4,4);
INSERT INTO "tbl_changelog" VALUES('contact',NULL,4,4);
INSERT INTO "tbl_changelog" VALUES('contact',NULL,6,4);
INSERT INTO "tbl_changelog" VALUES('contact',NULL,6,3);
COMMIT;
---->8---


(changetypes: 3 == deleted, 4 == modified)

And indeed this looks pretty strange - 4 tbl_changelog for 2 mappings ...

The information is missing which member was sending which changetype ...

I guess it should look like this:


----8<---
BEGIN TRANSACTION;
CREATE TABLE tbl_changelog (objtype VARCHAR(64) NOT NULL, memberid INTEGER NOT NULL, mappingid INTEGER NOT NULL, changetype INTEGER NOT NULL, PRIMARY KEY (objtype, memberid,
mappingid) );
INSERT INTO "tbl_changelog" VALUES('contact',1,4,4);
INSERT INTO "tbl_changelog" VALUES('contact',2,4,4);
INSERT INTO "tbl_changelog" VALUES('contact',1,6,4);
INSERT INTO "tbl_changelog" VALUES('contact',2,6,3);
COMMIT;
---->8---


Does this sound sane?
Does this address your question?

Best Regards,
Daniel


--
Daniel Gollub                        Geschaeftsfuehrer: Ralph Dehner
FOSS Developer                       Unternehmenssitz:  Vohburg
B1 Systems GmbH                      Amtsgericht:       Ingolstadt
Mobil: +49-(0)-160 47 73 970         Handelsregister:   HRB 3537
EMail: gollub@...          http://www.b1-systems.de

Adresse: B1 Systems GmbH, Osterfeldstraße 7, 85088 Vohburg
http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0xED14B95C2F8CA78D


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

signature.asc (204 bytes) Download Attachment

Re: osync_archive_save_ignored_conflict()

by Daniel Gollub-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sunday 08 November 2009 05:14:23 pm Daniel Gollub wrote:

> I guess it should look like this:
>
>
> ----8<---
> BEGIN TRANSACTION;
> CREATE TABLE tbl_changelog (objtype VARCHAR(64) NOT NULL, memberid INTEGER
>  NOT NULL, mappingid INTEGER NOT NULL, changetype INTEGER NOT NULL, PRIMARY
>  KEY (objtype, memberid,  mappingid) );
> INSERT INTO "tbl_changelog" VALUES('contact',1,4,4);
> INSERT INTO "tbl_changelog" VALUES('contact',2,4,4);
> INSERT INTO "tbl_changelog" VALUES('contact',1,6,4);
> INSERT INTO "tbl_changelog" VALUES('contact',2,6,3);
> COMMIT;
> ---->8---
>
Find attachtd a proof of concept patch which is implementing this ...

--

 archive/opensync_archive.c                 |   31 +++++++++++++++--------------
 archive/opensync_archive_internals.h       |    8 ++++---
 engine/opensync_mapping_engine.c           |   16 ++++++++++++++
 engine/opensync_mapping_engine_internals.h |    1
 engine/opensync_obj_engine.c               |   12 +++++++----
 mapping/opensync_mapping_entry_internals.h |    2 +
 6 files changed, 48 insertions(+), 22 deletions(-)

---


Index: opensync/mapping/opensync_mapping_entry_internals.h
===================================================================
--- opensync/mapping/opensync_mapping_entry_internals.h (revision 5920)
+++ opensync/mapping/opensync_mapping_entry_internals.h (working copy)
@@ -47,4 +47,6 @@
 
 /*@}*/
 
+long long int osync_mapping_entry_get_member_id(OSyncMappingEntry *entry);
+
 #endif /*OPENSYNC_MAPPING_ENTRY_INTERNALS_H_*/
Index: opensync/archive/opensync_archive.c
===================================================================
--- opensync/archive/opensync_archive.c (revision 5926)
+++ opensync/archive/opensync_archive.c (working copy)
@@ -94,7 +94,7 @@
  return TRUE;
  }
 
- query = "CREATE TABLE tbl_changelog (objtype VARCHAR(64), id INTEGER, entryid INTEGER, changetype INTEGER, PRIMARY KEY (objtype, id) )";
+ query = "CREATE TABLE tbl_changelog (objtype VARCHAR(64) NOT NULL, memberid INTEGER NOT NULL, mappingid INTEGER NOT NULL, changetype INTEGER NOT NULL, PRIMARY KEY
(objtype, memberid, mappingid) )";
  if (!osync_db_query(db, query, error)) {
  goto error;
  }
@@ -478,26 +478,27 @@
  return FALSE;
 }
 
-osync_bool osync_archive_load_ignored_conflicts(OSyncArchive *archive, const char *objtype, OSyncList **ids, OSyncList **changetypes, OSyncError **error)
+osync_bool osync_archive_load_ignored_conflicts(OSyncArchive *archive, const char *objtype, OSyncList **memberids, OSyncList **mappingids, OSyncList **changetypes,
OSyncError **error)
 {
  OSyncList *result = NULL, *row = NULL, *column = NULL;
  char *query = NULL;
  char *escaped_objtype = NULL;
- long long int id = 0;
+ long long int mappingid = 0, memberid = 0;
  int changetype = 0;
 
- osync_trace(TRACE_ENTRY, "%s(%p, %s, %p, %p)", __func__, archive, objtype, ids, error);
+ osync_trace(TRACE_ENTRY, "%s(%p, %s, %p, %p)", __func__, archive, objtype, mappingids, error);
 
  osync_assert(archive);
  osync_assert(objtype);
- osync_assert(ids);
+ osync_assert(memberids);
+ osync_assert(mappingids);
  osync_assert(changetypes);
 
  if (!osync_archive_create_changelog(archive->db, objtype, error))
  goto error;
 
  escaped_objtype = osync_db_sql_escape(objtype);
- query = osync_strdup_printf("SELECT entryid, changetype FROM tbl_changelog WHERE objtype='%s' ORDER BY id", escaped_objtype);
+ query = osync_strdup_printf("SELECT memberid, mappingid, changetype FROM tbl_changelog WHERE objtype='%s' ORDER BY mappingid", escaped_objtype);
  osync_free(escaped_objtype);
  escaped_objtype = NULL;
  result = osync_db_query_table(archive->db, query, error);
@@ -511,13 +512,15 @@
  for (row = result; row; row = row->next) {
  column = row->data;
 
- id = g_ascii_strtoull(osync_list_nth_data(column, 0), NULL, 0);
- changetype = atoi(osync_list_nth_data(column, 1));
+ memberid = g_ascii_strtoull(osync_list_nth_data(column, 0), NULL, 0);
+ mappingid = atoi(osync_list_nth_data(column, 1));
+ changetype = atoi(osync_list_nth_data(column, 2));
 
- *ids = osync_list_append((*ids), GINT_TO_POINTER((int)id));
+ *memberids = osync_list_append((*memberids), GINT_TO_POINTER((int)memberid));
+ *mappingids = osync_list_append((*mappingids), GINT_TO_POINTER((int)mappingid));
  *changetypes = osync_list_append((*changetypes), GINT_TO_POINTER((int)changetype));
 
- osync_trace(TRACE_INTERNAL, "Loaded ignored mapping with entryid %lli", id);
+ osync_trace(TRACE_INTERNAL, "Loaded ignored mapping with mappingid %lli", mappingid);
  }
 
  osync_db_free_list(result);
@@ -529,11 +532,11 @@
  return FALSE;
 }
 
-osync_bool osync_archive_save_ignored_conflict(OSyncArchive *archive, const char *objtype, long long int id, OSyncChangeType changetype, OSyncError **error)
+osync_bool osync_archive_save_ignored_conflict(OSyncArchive *archive, const char *objtype, long long int memberid, long long int mappingid, OSyncChangeType changetype,
OSyncError **error)
 {
  char *query = NULL;
  char *escaped_objtype = NULL;
- osync_trace(TRACE_ENTRY, "%s(%p, %s, %lli, %p)", __func__, archive, objtype, id, error);
+ osync_trace(TRACE_ENTRY, "%s(%p, %s, %lli, %lli, %p)", __func__, archive, objtype, memberid, mappingid, error);
 
  osync_assert(archive);
  osync_assert(objtype);
@@ -542,7 +545,7 @@
  goto error;
 
  escaped_objtype = osync_db_sql_escape(objtype);
- query = osync_strdup_printf("INSERT INTO tbl_changelog (objtype, entryid, changetype) VALUES('%s', '%lli', '%i')", escaped_objtype, id, changetype);
+ query = osync_strdup_printf("INSERT INTO tbl_changelog (objtype, memberid, mappingid, changetype) VALUES('%s', '%lli', '%lli', '%i')", escaped_objtype, memberid,
mappingid, changetype);
  osync_free(escaped_objtype);
  escaped_objtype = NULL;
 
@@ -553,7 +556,7 @@
 
  osync_free(query);
 
- osync_trace(TRACE_EXIT, "%s: %lli", __func__, id);
+ osync_trace(TRACE_EXIT, "%s: %lli", __func__, mappingid);
  return TRUE;
 
  error:
Index: opensync/archive/opensync_archive_internals.h
===================================================================
--- opensync/archive/opensync_archive_internals.h (revision 5926)
+++ opensync/archive/opensync_archive_internals.h (working copy)
@@ -136,24 +136,26 @@
  *
  * @param archive The group archive
  * @param objtype Requested object type
- * @param mappingsids List to store the archive (database) ids of each entry
+ * @param memberids List to store the member ids of each entry
+ * @param mappingsids List to store the mapping ids of each entry
  * @param changetypes List to store the changetypes for each entry
  * @param error Pointer to an error struct
  * @return TRUE on when all changes successfully loaded otherwise FALSE
  */
-osync_bool osync_archive_load_ignored_conflicts(OSyncArchive *archive, const char *objtype, OSyncList **mappingsids, OSyncList **changetypes, OSyncError **error);
+osync_bool osync_archive_load_ignored_conflicts(OSyncArchive *archive, const char *objtype, OSyncList **memberids, OSyncList **mappingsids, OSyncList **changetypes,
OSyncError **error);
 
 /**
  * @brief Saves an entry in the ignored conflict list.
  *
  * @param archive The group archive
  * @param objtype Reported object type of entry
+ * @param memberid Member ID of entry
  * @param mappingid Mapping Entry ID of entry
  * @param changetype Changetype of entry
  * @param error Pointer to an error struct
  * @return Returns TRUE on success, FALSE otherwise
  */
-osync_bool osync_archive_save_ignored_conflict(OSyncArchive *archive, const char *objtype, long long int mappingid, OSyncChangeType changetype, OSyncError **error);
+osync_bool osync_archive_save_ignored_conflict(OSyncArchive *archive, const char *objtype, long long int memberid, long long int mappingid, OSyncChangeType changetype,
OSyncError **error);
 
 /**
  * @brief Deletes all ignored conflict entries of the changelog with the objtype.
Index: opensync/engine/opensync_mapping_engine.c
===================================================================
--- opensync/engine/opensync_mapping_engine.c (revision 5920)
+++ opensync/engine/opensync_mapping_engine.c (working copy)
@@ -126,6 +126,20 @@
  }
 }
 
+OSyncMappingEntryEngine *osync_mapping_engine_find_entry_by_memberid(OSyncMappingEngine *engine, long long int memberid)
+{
+ OSyncList *e;
+ for (e = engine->entries; e; e = e->next) {
+ OSyncMappingEntryEngine *entry = e->data;
+
+ if (osync_mapping_entry_get_member_id(entry->entry) == memberid)
+ return entry;
+ }
+
+ return NULL;
+}
+
+
 static OSyncMappingEntryEngine *_osync_mapping_engine_find_entry(OSyncMappingEngine *engine, OSyncChange *change)
 {
  OSyncList *e;
@@ -620,7 +634,7 @@
 
  for (c = engine->entries; c; c = c->next) {
  OSyncMappingEntryEngine *entry = c->data;
- osync_archive_save_ignored_conflict(archive, objtype, id, osync_change_get_changetype(entry->change), error);
+ osync_archive_save_ignored_conflict(archive, objtype, osync_mapping_entry_get_member_id(entry->entry), id, osync_change_get_changetype(entry->change), error);
  }
 
  osync_status_update_mapping(engine->parent->parent, engine, OSYNC_ENGINE_MAPPING_EVENT_SOLVED, NULL);
Index: opensync/engine/opensync_obj_engine.c
===================================================================
--- opensync/engine/opensync_obj_engine.c (revision 5938)
+++ opensync/engine/opensync_obj_engine.c (working copy)
@@ -767,8 +767,8 @@
 
 static osync_bool _inject_changelog_entries(OSyncObjEngine *engine, OSyncError **error) {
  OSyncList *ids = NULL;
- OSyncList *changetypes = NULL;
- OSyncList *j = NULL, *t = NULL;
+ OSyncList *changetypes = NULL, *memberids = NULL;
+ OSyncList *j = NULL, *t = NULL, *mid = NULL;
 
  osync_trace(TRACE_ENTRY, "%s(%p)", __func__, engine);
 
@@ -776,12 +776,13 @@
  osync_assert(engine->archive);
  osync_assert(engine->objtype);
 
- if (!osync_archive_load_ignored_conflicts(engine->archive, engine->objtype, &ids, &changetypes, error)) {
+ if (!osync_archive_load_ignored_conflicts(engine->archive, engine->objtype, &memberids, &ids, &changetypes, error)) {
  osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error));
  return FALSE;
  }
 
  t = changetypes;
+ mid = memberids;
  for (j = ids; j; j = j->next) {
  long long int id = (long long int)GPOINTER_TO_INT(j->data);
 
@@ -793,8 +794,10 @@
 
  if (mapping_engine->mapping == ignored_mapping) {
  OSyncList *m;
+
  for (m = mapping_engine->entries; m; m = m->next) {
- OSyncMappingEntryEngine *entry = m->data;
+ long long int memberid = (long long int)GPOINTER_TO_INT(mid->data);
+ OSyncMappingEntryEngine *entry = osync_mapping_engine_find_entry_by_memberid(mapping_engine, memberid);
  OSyncChangeType changetype = (OSyncChangeType) t->data;
  OSyncChange *ignored_change = osync_change_new(error);
  OSyncObjFormat *dummyformat = NULL;
@@ -817,6 +820,7 @@
  }
 
  t = t->next;
+ mid = mid->next;
  }
 
  osync_list_free(ids);
Index: opensync/engine/opensync_mapping_engine_internals.h
===================================================================
--- opensync/engine/opensync_mapping_engine_internals.h (revision 5920)
+++ opensync/engine/opensync_mapping_engine_internals.h (working copy)
@@ -65,6 +65,7 @@
 osync_bool osync_mapping_engine_check_conflict(OSyncMappingEngine *engine);
 
 OSyncMappingEntryEngine *osync_mapping_engine_get_entry(OSyncMappingEngine *engine, OSyncSinkEngine *sinkengine);
+OSyncMappingEntryEngine *osync_mapping_engine_find_entry_by_memberid(OSyncMappingEngine *engine, long long int memberid);
 
 OSYNC_TEST_EXPORT unsigned int osync_mapping_engine_num_changes(OSyncMappingEngine *engine);
 


--
Daniel Gollub                        Geschaeftsfuehrer: Ralph Dehner
FOSS Developer                       Unternehmenssitz:  Vohburg
B1 Systems GmbH                      Amtsgericht:       Ingolstadt
Mobil: +49-(0)-160 47 73 970         Handelsregister:   HRB 3537
EMail: gollub@...          http://www.b1-systems.de

Adresse: B1 Systems GmbH, Osterfeldstraße 7, 85088 Vohburg
http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0xED14B95C2F8CA78D


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

signature.asc (204 bytes) Download Attachment

Re: osync_archive_save_ignored_conflict()

by Chris Frey-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Nov 08, 2009 at 05:14:23PM +0100, Daniel Gollub wrote:

> On Saturday 07 November 2009 12:58:38 am Chris Frey wrote:
> > Hi,
> >
> > In the opensync_archive_internals.h header, _save_ignored_conflict()
> > is documented as such:
> >
> > /**
> >  * @brief Saves an entry in the ignored conflict list.
> >  *
> >  * @param archive The group archive
> >  * @param objtype Reported object type of entry
> >  * @param mappingid Mapping Entry ID of entry
>
> That's correct.

[...]

> > Isn't the entryid field used for the archive id's themselves, and not the
> > mapping ids?
>
> Not quite sure which ID you mean for "archive id".

By "archive id" I'm referring to the IDs returned by the function
osync_archive_save_change(), which seems to be used in other functions
to refer to a row number in the tbl_changes table.

By "mapping id", I'm referring to IDs returned by the function
osync_mapping_table_get_next_id().

According to your email above, the ID in osync_archive_save_ignored_conflict()
is a mapping id.  This is what I was confused about.

It also seems like the id field in tbl_changelog is not used?


> While looking into this i found a bug in OpenSync which broke the support
> of "ignore conflicts". Which is hopefully fixed now with r5950
>
>
> Here is a dump of the tbl_changes and tbl_changelog, which contains two
> conflicts which got ignored. (I used for that a group with two file-sync members)
>

[snip]

>
> (changetypes: 3 == deleted, 4 == modified)
>
> And indeed this looks pretty strange - 4 tbl_changelog for 2 mappings ...
>
> The information is missing which member was sending which changetype ...
>
> I guess it should look like this:
>
>
> ----8<---
> BEGIN TRANSACTION;
> CREATE TABLE tbl_changelog (objtype VARCHAR(64) NOT NULL, memberid INTEGER NOT NULL, mappingid INTEGER NOT NULL, changetype INTEGER NOT NULL, PRIMARY KEY (objtype, memberid,
> mappingid) );
> INSERT INTO "tbl_changelog" VALUES('contact',1,4,4);
> INSERT INTO "tbl_changelog" VALUES('contact',2,4,4);
> INSERT INTO "tbl_changelog" VALUES('contact',1,6,4);
> INSERT INTO "tbl_changelog" VALUES('contact',2,6,3);
> COMMIT;
> ---->8---
>
>
> Does this sound sane?
> Does this address your question?

I'm sorry, but I don't fully understand the tables yet, so I can't
comment on whether it is sane.  It does look better that there are no
NULL values in the ID field.

My question was merely which ID belonged where, since I'm working on the
long long patch.

Thanks!
- Chris




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

Re: osync_archive_save_ignored_conflict()

by Chris Frey-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Nov 08, 2009 at 06:16:46PM +0100, Daniel Gollub wrote:
> Find attachtd a proof of concept patch which is implementing this ...

This patch makes it much clearer to follow the IDs through the system.
Thanks!

- Chris




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

Re: osync_archive_save_ignored_conflict()

by Daniel Gollub-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thursday 12 November 2009 10:23:59 pm Chris Frey wrote:
> This patch makes it much clearer to follow the IDs through the system.
> Thanks!
>

Ok, thanks for your feedback. Just committed the patch.

Best Regards,
Daniel

--
Daniel Gollub                        Geschaeftsfuehrer: Ralph Dehner
FOSS Developer                       Unternehmenssitz:  Vohburg
B1 Systems GmbH                      Amtsgericht:       Ingolstadt
Mobil: +49-(0)-160 47 73 970         Handelsregister:   HRB 3537
EMail: gollub@...          http://www.b1-systems.de

Adresse: B1 Systems GmbH, Osterfeldstraße 7, 85088 Vohburg
http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0xED14B95C2F8CA78D


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

signature.asc (204 bytes) Download Attachment

Re: osync_archive_save_ignored_conflict()

by Chris Frey-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Nov 13, 2009 at 05:16:49PM +0100, Daniel Gollub wrote:
> On Thursday 12 November 2009 10:23:59 pm Chris Frey wrote:
> > This patch makes it much clearer to follow the IDs through the system.
> > Thanks!
> >
>
> Ok, thanks for your feedback. Just committed the patch.

I noticed that your patch added a prototype for
osync_mapping_entry_get_member_id() to the opensync_mapping_entry_internals.h
header.

Yet that function already exists in opensync_mapping_entry.h

Was this intended?

- Chris




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

Re: osync_archive_save_ignored_conflict()

by Daniel Gollub-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 13 November 2009 10:33:12 pm Chris Frey wrote:
> I noticed that your patch added a prototype for
> osync_mapping_entry_get_member_id() to the
>  opensync_mapping_entry_internals.h header.
>
> Yet that function already exists in opensync_mapping_entry.h
>
> Was this intended?
>

No, this was not intended. I reverted it ... thanks for finding this!

Best Regards,
Daniel

--
Daniel Gollub                        Geschaeftsfuehrer: Ralph Dehner
FOSS Developer                       Unternehmenssitz:  Vohburg
B1 Systems GmbH                      Amtsgericht:       Ingolstadt
Mobil: +49-(0)-160 47 73 970         Handelsregister:   HRB 3537
EMail: gollub@...          http://www.b1-systems.de

Adresse: B1 Systems GmbH, Osterfeldstraße 7, 85088 Vohburg
http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0xED14B95C2F8CA78D


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

signature.asc (204 bytes) Download Attachment