Re: [Csync2] csync2-2.0 ans mysql backend

2014-12-10 Thread Гусев Павел
Good stuff! Thank you very much, this idea better than my)   -- С уважением,Гусев ПавелРуководитель отдела системного администрирования QSOFT | Ведущий web-интегратор офис 7(495) 771-7363 #110 | моб. 7(926) 850-1108pgu...@qsoft.ru  Москва, Авангардная улица, 3  |  qsoft.ruSan Francisco, 222 Columbus Ave |  qsoftus.com   10.12.2014, 23:56, "Lars Ellenberg" :On Wed, Dec 10, 2014 at 09:49:49PM +0100, Lars Ellenberg wrote: On Sun, Nov 30, 2014 at 09:56:19PM +0300, Paul A. Gusev wrote: 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. Works for me, though. Which mysql version? Is your mysql db / table created with some insensitive "collate" setting? It should be created with a binary (or case sensitive) collate setting. Maybe we should change the create database statement to explicitly include that, instead of putting a BINARY in every sql statement? Can you check if that works for you, too?Hm. No, that alone would not do it, considering trailing space padding :-(The create table statements needs to be changed to "TEXT BINARY NOT NULL".That should be good enough.Thanks,Lars___Csync2 mailing listCsync2@lists.linbit.comhttp://lists.linbit.com/mailman/listinfo/csync2___
Csync2 mailing list
Csync2@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/csync2


Re: [Csync2] csync2-2.0 ans mysql backend

2014-12-10 Thread Lars Ellenberg
On Wed, Dec 10, 2014 at 09:49:49PM +0100, Lars Ellenberg wrote:
> On Sun, Nov 30, 2014 at 09:56:19PM +0300, Paul A. Gusev wrote:
> > 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.
> 
> Works for me, though.
> 
> Which mysql version?
> Is your mysql db / table created with some insensitive "collate" setting?
> 
> It should be created with a binary (or case sensitive) collate setting.
> Maybe we should change the create database statement to explicitly
> include that, instead of putting a BINARY in every sql statement?
> Can you check if that works for you, too?

Hm. No, that alone would not do it, considering trailing space padding :-(
The create table statements needs to be changed to "TEXT BINARY NOT NULL".
That should be good enough.

Thanks,
Lars

___
Csync2 mailing list
Csync2@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/csync2


Re: [Csync2] csync2-2.0 ans mysql backend

2014-12-10 Thread Lars Ellenberg
On Sun, Nov 30, 2014 at 09:56:19PM +0300, Paul A. Gusev wrote:
> 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.

Works for me, though.

Which mysql version?
Is your mysql db / table created with some insensitive "collate" setting?

It should be created with a binary (or case sensitive) collate setting.
Maybe we should change the create database statement to explicitly
include that, instead of putting a BINARY in every sql statement?
Can you check if that works for you, too?

Thanks,
Lars

> 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


Re: [Csync2] csync2-2.0 ans mysql backend

2014-11-30 Thread Paul A . Gusev
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