Hi!
Today i have some troubles with mysql backend. 
If you make two files with name in different registers (i.e. 1.jpg and 1.JPG) in the same directory , csync2 cannot work corretly.
I have execute this query:
SELECT * FROM file WHERE filename like '1.JPG'
and received 1.jpg file only in the result (result no contains 1.JPG file)
Then, I have execute this query:
SELECT * FROM file WHERE upper(filename) LIKE lower('1.JPG')
and received same result - 1.jpg.
So, i want use two files, 1.jpg and 1.JPG in my synchronization.
 
Then I go to the source of csync2-2.0 and change some files, see this:
# grep -Hnri \ BINARY\  .
./check.c:104: "DELETE FROM dirty WHERE BINARY filename = '%s' AND peername = '%s'",
./check.c:245:     "DELETE FROM file WHERE BINARY filename = '%s'",
./check.c:323:     "DELETE FROM file WHERE BINARY filename = '%s'",
./daemon.c:64: "SELECT 1 FROM dirty WHERE BINARY filename = '%s' LIMIT 1",
./daemon.c:79: "delete from dirty where BINARY filename = '%s' and peername = '%s'",
./daemon.c:83: "delete from file where BINARY filename = '%s'",
./daemon.c:89: "DELETE FROM file WHERE BINARY filename = '%s'",
./daemon.c:102: "delete from dirty where BINARY filename ='%s'",
./daemon.c:624: "DELETE FROM dirty WHERE BINARY filename = '%s'",
./daemon.c:715: strcmp(tag[2], "-") ? "WHERE BINARY filename = '" : "",
./csync2.c:717:     "DELETE FROM hint WHERE BINARY filename = '%s' "
./csync2.c:786: "SELECT filename FROM file WHERE BINARY filename = '%s' %s",
./csync2.c:814: "UPDATE dirty SET forced = 1 WHERE BINARY filename = '%s' %s",
./update.c:240: "DELETE FROM dirty WHERE BINARY filename = '%s' "
./update.c:481: "DELETE FROM dirty WHERE BINARY filename = '%s' "
./update.c:601: "SELECT filename FROM file WHERE BINARY filename = '%s' UNION ALL "
./update.c:1009: filename ? "WHERE BINARY filename = '" : "",
./update.c:1169:     "DELETE FROM dirty WHERE BINARY filename = '%s' AND peername = '%s'", t->value, t->value2);
./update.c:1183:     "DELETE FROM file WHERE BINARY filename = '%s'", t->value);
 
After csync2 -cIr 
I have correct DB:
mysql> select * from file;
+------------------+------------------------------------------------------------------------+
| filename         | checktxt                                                               |
+------------------+------------------------------------------------------------------------+
| /root/test       | v1%3Amode=16877%3Auid=0%3Agid=0%3Atype=dir                             |
| /root/test/1.jpg | v1%3Amtime=1417367880%3Amode=33188%3Auid=0%3Agid=0%3Atype=reg%3Asize=0 |
| /root/test/1.JPG | v1%3Amtime=1417369199%3Amode=33188%3Auid=0%3Agid=0%3Atype=reg%3Asize=0 |
+------------------+------------------------------------------------------------------------+
3 rows in set (0.00 sec)
 
This is correctly work only for MySQL only, but may be helpful for anybody with mysql backend
_______________________________________________
Csync2 mailing list
Csync2@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/csync2

Reply via email to