Kaynağa Gözat

최근 변경 속도 최적화 2

Surplus_Up (2DU) 6 yıl önce
ebeveyn
işleme
963688d4b6

+ 1 - 1
emergency_tool.py

@@ -270,7 +270,7 @@ elif what_i_do == '11':
     except:
         pass
 elif what_i_do == '12':
-    curs.execute(db_change("select count(title) from data"))
+    curs.execute(db_change("select count(*) from data"))
     count_data = curs.fetchall()
     if count_data:
         count_data = count_data[0][0]

+ 2 - 2
route/list_title_index.py

@@ -31,7 +31,7 @@ def list_title_index_2(conn):
 
         curs.execute(db_change('select data from other where name = "count_all_title"'))
         if int(curs.fetchall()[0][0]) < 30000:
-            curs.execute(db_change("select count(title) from data"))
+            curs.execute(db_change("select count(*) from data"))
             count = curs.fetchall()
             if count:
                 count_end += [count[0][0]]
@@ -40,7 +40,7 @@ def list_title_index_2(conn):
 
             sql_list = ['category:', 'user:', 'file:']
             for sql in sql_list:
-                curs.execute(db_change("select count(title) from data where title like ?"), [sql + '%'])
+                curs.execute(db_change("select count(*) from data where title like ?"), [sql + '%'])
                 count = curs.fetchall()
                 if count:
                     count_end += [count[0][0]]

+ 1 - 3
route/recent_changes.py

@@ -103,9 +103,7 @@ def recent_changes_2(conn, name, tool):
 
             curs.execute(db_change('' + \
                 'select id, title, date, ip, send, leng, hide from history ' + \
-                plus_sql + \
-                'order by date desc ' + \
-                'limit ?, 50' + \
+                plus_sql + 'and date in (select date from history order by date desc limit ?, 50) order by date desc' + \
             ''), [sql_num])
 
         div += '</tr>'

+ 2 - 2
route/tool/func.py

@@ -769,7 +769,7 @@ def custom():
             user_admin = '0'
             user_acl_list = '0'
 
-        curs.execute(db_change("select count(name) from alarm where name = ?"), [ip])
+        curs.execute(db_change("select count(*) from alarm where name = ?"), [ip])
         count = curs.fetchall()
         if count:
             user_notice = str(count[0][0])
@@ -980,7 +980,7 @@ def acl_check(name = 'test', tool = '', topic_num = '1'):
                     if admin_check(num) == 1:
                         return 0
                     else:
-                        curs.execute(db_change("select count(title) from history where ip = ?"), [ip])
+                        curs.execute(db_change("select count(*) from history where ip = ?"), [ip])
                         count = curs.fetchall()
                         count = count[0][0] if count else 0
                         if count >= 50:

+ 2 - 2
route/user_count_edit.py

@@ -8,14 +8,14 @@ def user_count_edit_2(conn, name):
     else:
         that = name
 
-    curs.execute(db_change("select count(title) from history where ip = ?"), [that])
+    curs.execute(db_change("select count(*) from history where ip = ?"), [that])
     count = curs.fetchall()
     if count:
         data = count[0][0]
     else:
         data = 0
 
-    curs.execute(db_change("select count(code) from topic where ip = ?"), [that])
+    curs.execute(db_change("select count(*) from topic where ip = ?"), [that])
     count = curs.fetchall()
     if count:
         t_data = count[0][0]

+ 1 - 1
route/user_info.py

@@ -5,7 +5,7 @@ def user_info_2(conn):
 
     ip = ip_check()
 
-    curs.execute(db_change("select count(name) from alarm where name = ?"), [ip])
+    curs.execute(db_change("select count(*) from alarm where name = ?"), [ip])
     count = curs.fetchall()
     if count and count[0][0] != 0:
         plus2 = '<li><a id="not_thing" href="/alarm">' + load_lang('alarm') + ' (' + str(count[0][0]) + ')</a></li>'

+ 1 - 1
route/watch_list_name.py

@@ -8,7 +8,7 @@ def watch_list_name_2(conn, tool, name):
         return redirect('/login')
 
     if tool == 'watch_list':
-        curs.execute(db_change("select count(title) from scan where user = ?"), [ip])
+        curs.execute(db_change("select count(*) from scan where user = ?"), [ip])
         count = curs.fetchall()
         if count and count[0][0] > 9:
             return re_error('/error/28')

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "master" : {
-        "r_ver" : "v3.1.9-master-10",
+        "r_ver" : "v3.1.9-master-11",
         "c_ver" : "3190201",
         "s_ver" : "8"
     }, "stable" : {