Changeset: ba91742ee52c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ba91742ee52c
Modified Files:
sql/test/BugTracker-2013/Tests/empty-strings.Bug-3261.SQL.py
Branch: Mar2025
Log Message:
Create table with content without creating huge Python string.
diffs (27 lines):
diff --git a/sql/test/BugTracker-2013/Tests/empty-strings.Bug-3261.SQL.py
b/sql/test/BugTracker-2013/Tests/empty-strings.Bug-3261.SQL.py
--- a/sql/test/BugTracker-2013/Tests/empty-strings.Bug-3261.SQL.py
+++ b/sql/test/BugTracker-2013/Tests/empty-strings.Bug-3261.SQL.py
@@ -6,16 +6,8 @@ db = os.environ['TSTDB']
cli = pymonetdb.connect(port=port,database=db,autocommit=True)
cur = cli.cursor()
-q = []
-q.append(("start transaction; create table bug3261 (probeid int, markername
varchar(64));\n"
- "copy %d records into bug3261 from stdin using delimiters "
- "E'\\t',E'\\n','' null as 'null';\n") % (1455 * 3916))
-for i in range(1,1456):
- v = 'rmm%d' % i
- for j in range(3916):
- q.append('%d\t%s\n' % (j, v))
-q.append("commit;")
-cur.execute(''.join(q))
+q = f"create table bug3261 as (select (value % 1456) + 1 as probeid, 'rmm' ||
cast((value / 1456) + 1 as string) as markername from
sys.generate_series(0,{1456 * 3916}));\n"
+cur.execute(q)
cur.close()
cli.close()
@@ -32,4 +24,3 @@ cur = cli.cursor()
cur.execute('drop table bug3261;')
cur.close()
cli.close()
-
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]