You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/__init__.py
+6-5Lines changed: 6 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -31,12 +31,12 @@
31
31
32
32
cnx = pymysql.connect(database="MySQL_Database")
33
33
cursor = cnx.cursor()
34
-
cursor.execute("INSERT INTO test (testField) VALUES (123)"
34
+
cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
35
+
cursor.execute("INSERT INTO test (testField) VALUES (123)")
35
36
cnx.commit()
36
37
cursor.close()
37
38
cnx.close()
38
39
39
-
40
40
.. code:: python
41
41
42
42
import pymysql
@@ -53,7 +53,8 @@
53
53
}
54
54
)
55
55
cursor = instrumented_cnx.cursor()
56
-
cursor.execute("INSERT INTO test (testField) VALUES (123)"
56
+
cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
57
+
cursor.execute("INSERT INTO test (testField) VALUES (123)")
57
58
instrumented_cnx.commit()
58
59
cursor.close()
59
60
instrumented_cnx.close()
@@ -75,12 +76,12 @@
75
76
76
77
cnx = pymysql.connect(database="MySQL_Database")
77
78
cursor = cnx.cursor()
78
-
cursor.execute("INSERT INTO test (testField) VALUES (123)"
79
+
cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
80
+
cursor.execute("INSERT INTO test (testField) VALUES (123)")
0 commit comments