/ Check-in [fd8b8c41]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Convert the schema creation logic in the rtree extension to use the new sqlite3_str interface.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: fd8b8c4196d3f0f6cb129f43ebf473ada86eefdf16181fa70ceee21e1232b5e1
User & Date: drh 2018-05-14 15:26:05
Context
2018-05-14
22:46
Make more aggressive use of automatic indexes when processing materalized views and subqueries. check-in: 172f5bd2 user: drh tags: trunk
17:12
Experimental syntax enhancement for an "INDEXED" keyword following a FROM-clause subquery that indicates that an automatic index on that subquery is suggested. check-in: 32b3d110 user: drh tags: exp-indexed-clause
15:26
Convert the schema creation logic in the rtree extension to use the new sqlite3_str interface. check-in: fd8b8c41 user: drh tags: trunk
12:23
Fix typo in the shell.c source file. check-in: 389dc0a9 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to ext/rtree/rtree.c.

3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503


3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
  ** that is successful, call sqlite3_declare_vtab() to configure
  ** the r-tree table schema.
  */
  if( rc==SQLITE_OK ){
    if( (rc = rtreeSqlInit(pRtree, db, argv[1], argv[2], isCreate)) ){
      *pzErr = sqlite3_mprintf("%s", sqlite3_errmsg(db));
    }else{
      char *zSql = sqlite3_mprintf("CREATE TABLE x(%s", argv[3]);
      char *zTmp;
      int ii;
      for(ii=4; zSql && ii<argc; ii++){
        zTmp = zSql;
        zSql = sqlite3_mprintf("%s, %s", zTmp, argv[ii]);
        sqlite3_free(zTmp);


      }
      if( zSql ){
        zTmp = zSql;
        zSql = sqlite3_mprintf("%s);", zTmp);
        sqlite3_free(zTmp);
      }
      if( !zSql ){
        rc = SQLITE_NOMEM;
      }else if( SQLITE_OK!=(rc = sqlite3_declare_vtab(db, zSql)) ){
        *pzErr = sqlite3_mprintf("%s", sqlite3_errmsg(db));
      }
      sqlite3_free(zSql);







|
|

|
|
|
|
>
>
|
<
<
|
|







3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506


3507
3508
3509
3510
3511
3512
3513
3514
3515
  ** that is successful, call sqlite3_declare_vtab() to configure
  ** the r-tree table schema.
  */
  if( rc==SQLITE_OK ){
    if( (rc = rtreeSqlInit(pRtree, db, argv[1], argv[2], isCreate)) ){
      *pzErr = sqlite3_mprintf("%s", sqlite3_errmsg(db));
    }else{
      sqlite3_str *pSql = sqlite3_str_new(db);
      char *zSql;
      int ii;
      if( pSql==0 ){
        zSql = 0;
      }else{
        sqlite3_str_appendf(pSql, "CREATE TABLE x(%s", argv[3]);
        for(ii=4; ii<argc; ii++){
          sqlite3_str_appendf(pSql, ", %s", argv[ii]);
        }


        sqlite3_str_appendf(pSql, ");");
        zSql = sqlite3_str_finish(pSql);
      }
      if( !zSql ){
        rc = SQLITE_NOMEM;
      }else if( SQLITE_OK!=(rc = sqlite3_declare_vtab(db, zSql)) ){
        *pzErr = sqlite3_mprintf("%s", sqlite3_errmsg(db));
      }
      sqlite3_free(zSql);