-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, List!
As I promise, here my patch, to solve the problem I explained on 18.06.2010. I'm now sure, my patch is NOT responsible of the problem sending SMS, then I'd like to submit it to the list. Greetings - -- _______________________________________________________________________ Luca Bertoncello Entwicklung Mail: bertonce...@netzing.de NETZING Solutions AG Tel.: 0351/41381 - 0 Kesselsdorfer Str. 216, 01169 Dresden Fax: 0351/41381 - 12 HRB 18926 / Ust.ID DE211326547 Mail: netzing...@netzing.de _______________________________________________________________________ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFMIdheAXzltVKV/2wRAnhaAJ96NdDGLzdAxvn6e1XV8uF8Xf62mACgqbPp AD8uCeWjX/poI/fycmE0R1Y= =+3SS -----END PGP SIGNATURE-----
diff --git a/a/openbsc/src/db.c b/b/openbsc/src/db.c index 72e6bd3..3731ade 100644 --- a/a/openbsc/src/db.c +++ b/b/openbsc/src/db.c @@ -307,10 +307,9 @@ static int get_equipment_by_subscr(struct gsm_subscriber *subscr) struct gsm_equipment *equip = &subscr->equipment; result = dbi_conn_queryf(conn, - "SELECT equipment.* FROM Equipment,EquipmentWatch " - "WHERE EquipmentWatch.equipment_id=Equipment.id " - "AND EquipmentWatch.subscriber_id = %llu " - "ORDER BY updated DESC", subscr->id); + "SELECT equipment.* FROM Equipment JOIN EquipmentWatch ON(EquipmentWatch.equipment_id=Equipment.id) " + "WHERE EquipmentWatch.subscriber_id = %llu " + "ORDER BY Equipment.updated DESC", subscr->id); if (!result) return -EIO; @@ -1058,11 +1057,10 @@ struct gsm_sms *db_sms_get_unsent_by_subscr(struct gsm_network *net, unsigned lo struct gsm_sms *sms; result = dbi_conn_queryf(conn, - "SELECT * FROM SMS,Subscriber " + "SELECT * FROM SMS JOIN Subscriber ON (SMS.receiver_id = Subscriber.id) " "WHERE sms.receiver_id >= %llu AND sms.sent is NULL " - "AND sms.receiver_id = subscriber.id " "AND subscriber.lac > 0 " - "ORDER BY sms.receiver_id, id LIMIT 1", + "ORDER BY sms.receiver_id, sms.id LIMIT 1", min_subscr_id); if (!result) return NULL;