a00ea9be88393565c2cdf2e8b8904c493354ba54,mindsdb/integrations/mysql/mysql.py,MySQL,_query,#MySQL#Any#,42

Before Change



    def _query(self, query):
        con = mysql.connector.connect(
            host=self.config["integrations"][self.name]["host"],
            port=self.config["integrations"][self.name]["port"],
            user=self.config["integrations"][self.name]["user"],
            password=self.config["integrations"][self.name]["password"]

After Change



    def _query(self, query):
        con = self._get_connnection()
        with closing(con) as con:
            cur = con.cursor(dictionary=True, buffered=True)
            cur.execute(query)
            res = True
            try:
                res = cur.fetchall()
            except Exception:
                pass
            con.commit()

        return res

    def _get_connect_string(self, table):
        user = f"{self.config["api"]["mysql"]["user"]}_{self.name}"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: mindsdb/mindsdb
Commit Name: a00ea9be88393565c2cdf2e8b8904c493354ba54
Time: 2021-02-17
Author: ilya@mindsdb.com
File Name: mindsdb/integrations/mysql/mysql.py
Class Name: MySQL
Method Name: _query


Project Name: mindsdb/mindsdb
Commit Name: a00ea9be88393565c2cdf2e8b8904c493354ba54
Time: 2021-02-17
Author: ilya@mindsdb.com
File Name: mindsdb/integrations/postgres/postgres.py
Class Name: PostgreSQL
Method Name: _query


Project Name: home-assistant/home-assistant
Commit Name: dfa81b0117708a41a64d3bb7d11104d115d35d2b
Time: 2015-11-08
Author: ryan.e.t@gmail.com
File Name: homeassistant/components/camera/mjpeg.py
Class Name: MjpegCamera
Method Name: camera_image