aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Ippolitov A. Igor2015-10-27 10:46:13 +0300
committerGravatar Ippolitov A. Igor2015-10-27 10:46:13 +0300
commit9a8539699c88f5d4bf40a65501038cefddc014be (patch)
tree090a0e99bbfacb06c05524b1c683abc6cf39722b /src
parentb5df0e1c2664a8a1a0f9042745dd608773fedce3 (diff)
insert null instead of '' for tags
Diffstat (limited to 'src')
-rw-r--r--src/com/juick/server/MessagesQueries.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/juick/server/MessagesQueries.java b/src/com/juick/server/MessagesQueries.java
index 8bef9018..17e9f832 100644
--- a/src/com/juick/server/MessagesQueries.java
+++ b/src/com/juick/server/MessagesQueries.java
@@ -81,7 +81,11 @@ public class MessagesQueries {
try {
stmt = sql.prepareStatement("INSERT INTO messages_txt(message_id,tags,txt) VALUES (?,?,?)");
stmt.setInt(1, mid);
- stmt.setString(2, tagsNames);
+ if (tagsNames == "") {
+ stmt.setNull(2, Types.VARCHAR);
+ } else {
+ stmt.setString(2, tagsNames);
+ }
stmt.setString(3, txt);
stmt.executeUpdate();
} catch (SQLException e) {
@@ -733,6 +737,7 @@ public class MessagesQueries {
PreparedStatement stmt = null;
ResultSet rs = null;
try {
+
if (before > 0) {
stmt = sqlSearch.prepareStatement("SELECT id AS message_id FROM messages WHERE MATCH(?) AND id<? ORDER BY id DESC LIMIT 25");
stmt.setString(1, search);