Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here

NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

Author Topic: Database query - incorrect results  (Read 1552 times)

Offline Mk12

  • Newbie
  • *
  • Posts: 3
Database query - incorrect results
« on: March 14, 2016, 01:23:56 AM »
Hi, I am developing a plugin which runs a query as follows (the IP addresses are converted into numbers):

sql = 'SELECT * FROM iprangebans WHERE start_ip <= %d AND end_ip >= %d AND time_end > 0' % (comparisonIP, comparisonIP)
cursor = self.console.storage.query(sql)
...
cursor.close()

The correct results are returned (for example, 1 row). However, I then externally edit the data in MySQL (for example, delete all rows in the table) and it STILL CONTINUES to return the original data. When I restart b3, then it notices that the data has changed.

Does anyone know what the cause of this is, and how I can get around it? This is driving me insane.

Thanks.

Offline Mk12

  • Newbie
  • *
  • Posts: 3
Re: Database query - incorrect results
« Reply #1 on: March 14, 2016, 03:37:31 AM »
Basically, how can it be that rows are coming from a truncated table? Thanks.

 


Rate this page +1 at Google Search

anything