[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-20
From: |
Jan Derfinak |
Subject: |
[SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-202-g3858598 |
Date: |
Mon, 28 Feb 2011 00:18:20 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "libgnokii and core programs".
The branch, master has been updated
via 3858598bf06c9204f1dc2c4f79acb0057a889318 (commit)
from e429a225c8781ec42b43571a591046c886903cbd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=3858598bf06c9204f1dc2c4f79acb0057a889318
commit 3858598bf06c9204f1dc2c4f79acb0057a889318
Author: Jan Derfinak <address@hidden>
Date: Mon Feb 28 01:17:06 2011 +0100
Enabled sending long sms in PostgreSQL, Added CHECK () constrain to outbox
table definition for PostgreSQL and MySQL
diff --git a/smsd/ChangeLog b/smsd/ChangeLog
index bf095ea..d9f5b18 100644
--- a/smsd/ChangeLog
+++ b/smsd/ChangeLog
@@ -1,3 +1,11 @@
+* Man 28 Feb 2011 Jan Derfinak
+- Changed type of column 'outbox.text' from 'varchar(160)' to 'text' to enable
+ sending long sms in PostgreSQL.
+- Added CHECK () constrain to outbox table definition for PostgreSQL and
+ MySQL to disable inserting of sms with empty phone number. It works only
+ for PostgreSQL, because it is parsed but not implemented in MySQL server.
+
+
* Sun 20 Feb 2011 Jan Derfinak
- Simplify DB_Connect functions in pq and mysql modules by moving shared
code to the separate function. (Pawel Kot)
diff --git a/smsd/mysql.c b/smsd/mysql.c
index 8ca5156..dcd296b 100644
--- a/smsd/mysql.c
+++ b/smsd/mysql.c
@@ -319,7 +319,7 @@ GNOKII_API void DB_Look (const gchar * const phone)
g_string_printf (phnStr, "AND phone = '%s'", phone);
}
- buf = g_string_sized_new (128);
+ buf = g_string_sized_new (256);
g_string_printf (buf, "SELECT id, number, text, dreport FROM outbox \
WHERE processed='0' AND CURTIME() >= not_before \
diff --git a/smsd/pq.c b/smsd/pq.c
index 68e9d49..1a93b5a 100644
--- a/smsd/pq.c
+++ b/smsd/pq.c
@@ -356,7 +356,7 @@ GNOKII_API void DB_Look (const gchar * const phone)
g_string_printf (phnStr, "AND phone = '%s'", phone);
}
- buf = g_string_sized_new (128);
+ buf = g_string_sized_new (256);
g_string_printf (buf, "SELECT id, number, text, dreport FROM %s.outbox \
WHERE processed='f' AND localtime(0) >= not_before \
diff --git a/smsd/sms.tables.mysql.sql b/smsd/sms.tables.mysql.sql
index d8cfefb..0f1c4e7 100644
--- a/smsd/sms.tables.mysql.sql
+++ b/smsd/sms.tables.mysql.sql
@@ -15,10 +15,11 @@ CREATE TABLE inbox (
CREATE TABLE outbox (
id int(10) unsigned NOT NULL auto_increment,
- number varchar(20) NOT NULL default '',
+-- MySQL parses but ignores CHECK clause
+ number varchar(20) NOT NULL CHECK (number <> ''),
processed_date timestamp DEFAULT 0,
insertdate timestamp DEFAULT CURRENT_TIMESTAMP,
- text varchar(160) default NULL,
+ text text default NULL,
phone tinyint(4),
processed tinyint(4) NOT NULL default '0',
error tinyint(4) NOT NULL default '-1',
@@ -33,7 +34,7 @@ CREATE TABLE multipartinbox (
number varchar(20) NOT NULL default '',
smsdate datetime NOT NULL default '0000-00-00 00:00:00',
insertdate timestamp DEFAULT CURRENT_TIMESTAMP,
- text text,
+ text varchar(160),
phone tinyint(4),
processed tinyint(4) NOT NULL default '0',
refnum smallint default NULL,
diff --git a/smsd/sms.tables.pq.sql b/smsd/sms.tables.pq.sql
index 544bd08..666a46a 100644
--- a/smsd/sms.tables.pq.sql
+++ b/smsd/sms.tables.pq.sql
@@ -22,10 +22,10 @@ CREATE TABLE "inbox" (
CREATE TABLE "outbox" (
"id" serial,
- "number" character varying(20) NOT NULL,
+ "number" character varying(20) NOT NULL CHECK (number <> ''),
"processed_date" timestamp DEFAULT now() NOT NULL,
"insertdate" timestamp DEFAULT now() NOT NULL,
- "text" character varying(160),
+ "text" text,
"phone" integer,
"processed" bool DEFAULT 'false',
"error" smallint DEFAULT '-1' NOT NULL,
-----------------------------------------------------------------------
Summary of changes:
smsd/ChangeLog | 8 ++++++++
smsd/mysql.c | 2 +-
smsd/pq.c | 2 +-
smsd/sms.tables.mysql.sql | 7 ++++---
smsd/sms.tables.pq.sql | 4 ++--
5 files changed, 16 insertions(+), 7 deletions(-)
hooks/post-receive
--
libgnokii and core programs
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-202-g3858598,
Jan Derfinak <=