![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Summary: SSQLS compare operators patch Project: MySQL++ Submitted by: breeeze Submitted on: Пятница 20.10.2006 at 06:34 Category: None Priority: 5 - Normal Severity: 3 - Normal Status: None Privacy: Public Assigned to: None Originator Email: Open/Closed: Open __________________________________________________ _____ Details: I guess it'll be better decision to store all patches at gna.org This is a small patch to custom.pl, which using normal compare operators. |
#2
| |||
| |||
|
|
Follow-up Comment #4, bug #7474 (project mysqlpp): In current implementation, compare looks like int cmp; \ cmp = mysqlpp::sql_cmp(x.C1 , y.C1 ); \ if (cmp) return cmp; \ cmp = mysqlpp::sql_cmp(x.C2 , y.C2 ); etc sql_cmp (custom.h) need general types, so it seems to me comparing for example sql_datetime, lead to 2 converts sql_datetime=>std::string (correct me, if I wrong). New implementation use bool operator == (const NAME &other) const{\ bool cmp; \ cmp = (C1 == other.C1 ); \ if (cmp) return cmp; \ cmp = (C2 == other.C2 ); \ if (cmp) return cmp; \ return (C3 == other.C3);\ \ } so, to compare sql_datetime, operator==() shoud be used without any conversion. I guess it should be faster |
![]() |
| Thread Tools | |
| Display Modes | |
| |