aboutsummaryrefslogtreecommitdiff
path: root/src/com/juick/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/juick/server')
-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);