diff options
author | Ippolitov A. Igor | 2015-10-27 10:59:23 +0300 |
---|---|---|
committer | Ippolitov A. Igor | 2015-10-27 10:59:23 +0300 |
commit | 96b4a36d13225ed81aff46b29721678480055ee5 (patch) | |
tree | 481c3e9ae581cfb70af8c025dc299f39cc0c7c55 | |
parent | 340582b97d26625307174c692c3775c89a5f41f2 (diff) | |
parent | 9a8539699c88f5d4bf40a65501038cefddc014be (diff) |
Merge branch 'master' into develop
-rw-r--r-- | src/main/java/com/juick/server/MessagesQueries.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/com/juick/server/MessagesQueries.java b/src/main/java/com/juick/server/MessagesQueries.java index 8bef9018..17e9f832 100644 --- a/src/main/java/com/juick/server/MessagesQueries.java +++ b/src/main/java/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); |