aboutsummaryrefslogtreecommitdiffstats
path: root/include/import.php
diff options
context:
space:
mode:
authorFlorian Steinel <fsteinel@users.noreply.github.com>2016-10-27 02:41:32 +0200
committerFlorian Steinel <fsteinel@users.noreply.github.com>2016-10-27 02:41:32 +0200
commitc1c96e01fab131dd48cd68cdd9b63639e269d9c8 (patch)
tree3df5a97bc8829cdf811498e6f79c5653a7f7be73 /include/import.php
parentc3af36d33b9a08aacecd572ad17fe33362617d23 (diff)
downloadvolse-hubzilla-c1c96e01fab131dd48cd68cdd9b63639e269d9c8.tar.gz
volse-hubzilla-c1c96e01fab131dd48cd68cdd9b63639e269d9c8.tar.bz2
volse-hubzilla-c1c96e01fab131dd48cd68cdd9b63639e269d9c8.zip
sql: limit 1 for UPDATE and DELETE is not supported by the SQL standard and postgresql
(see: https://www.postgresql.org/message-id/flat/1291109101.26137.35.camel%40pcd12478 )
Diffstat (limited to 'include/import.php')
-rw-r--r--include/import.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/import.php b/include/import.php
index 49cdb2574..0d8398acb 100644
--- a/include/import.php
+++ b/include/import.php
@@ -227,7 +227,7 @@ function sync_objs($channel,$objs) {
foreach($objs as $obj) {
if(array_key_exists('obj_deleted',$obj) && $obj['obj_deleted'] && $obj['obj_obj']) {
- q("delete from obj where obj_obj = '%s' and obj_channel = %d limit 1",
+ q("delete from obj where obj_obj = '%s' and obj_channel = %d",
dbesc($obj['obj_obj']),
intval($channel['channel_id'])
);
@@ -351,7 +351,7 @@ function sync_apps($channel,$apps) {
}
if(array_key_exists('app_deleted',$app) && $app['app_deleted'] && $app['app_id']) {
- q("delete from app where app_id = '%s' and app_channel = %d limit 1",
+ q("delete from app where app_id = '%s' and app_channel = %d",
dbesc($app['app_id']),
intval($channel['channel_id'])
);
@@ -416,7 +416,7 @@ function sync_apps($channel,$apps) {
create_table_from_array('app',$app);
if($term) {
- $x = q("select * from app where app_id = '%s' and app_channel = %d limit 1",
+ $x = q("select * from app where app_id = '%s' and app_channel = %d",
dbesc($hash),
intval($channel['channel_id'])
);
@@ -466,7 +466,7 @@ function sync_chatrooms($channel,$chatrooms) {
continue;
if(array_key_exists('cr_deleted',$chatroom) && $chatroom['cr_deleted']) {
- q("delete from chatroom where cr_name = '%s' and cr_uid = %d limit 1",
+ q("delete from chatroom where cr_name = '%s' and cr_uid = %d",
dbesc($chatroom['cr_name']),
intval($channel['channel_id'])
);
@@ -635,7 +635,7 @@ function sync_events($channel,$events) {
continue;
if($event['event_deleted']) {
- $r = q("delete from event where event_hash = '%s' and uid = %d limit 1",
+ $r = q("delete from event where event_hash = '%s' and uid = %d",
dbesc($event['event_hash']),
intval($channel['channel_id'])
);
@@ -889,14 +889,14 @@ function import_mail($channel,$mails,$sync = false) {
if($channel && $mails) {
foreach($mails as $mail) {
if(array_key_exists('flags',$mail) && in_array('deleted',$mail['flags'])) {
- q("delete from mail where mid = '%s' and uid = %d limit 1",
+ q("delete from mail where mid = '%s' and uid = %d",
dbesc($mail['message_id']),
intval($channel['channel_id'])
);
continue;
}
if(array_key_exists('flags',$mail) && in_array('recalled',$mail['flags'])) {
- q("update mail set mail_recalled = 1 where mid = '%s' and uid = %d limit 1",
+ q("update mail set mail_recalled = 1 where mid = '%s' and uid = %d",
dbesc($mail['message_id']),
intval($channel['channel_id'])
);