Fossil

Check-in [ed6b0c0b5c]
Login

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

Overview
Comment:Simplifications to db_get_manifest_setting().
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | versioned-manifest-setting
Files: files | file ages | folders
SHA3-256: ed6b0c0b5c65c8def8de5c9bf8f5ecf28f46768f6e53b20a42a6c1ff43bf40c8
User & Date: drh 2025-03-12 23:58:15.823
Context
2025-03-13
00:26
Further simplification of db_get_manifest_setting(): No need to check in global_config because manifest cannot be set globally. check-in: b89520f227 user: drh tags: versioned-manifest-setting
2025-03-12
23:58
Simplifications to db_get_manifest_setting(). check-in: ed6b0c0b5c user: drh tags: versioned-manifest-setting
21:48
Here is a possible solution to the versioned "manifest" setting. Needs lots of testing. check-in: eb41a9f3c4 user: drh tags: versioned-manifest-setting
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/db.c.
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
  char *zVal;
  
  /* Look for the versioned setting first */
  zVal = db_get_versioned("manifest", 0, zCkin);

  if( zVal==0 && g.repositoryOpen ){
    /* No versioned setting, look for the repository setting second */
    static char *zCached = 0;
    if( zCached ){
      zVal = zCached;
    }else{
      zVal = db_text(0, "SELECT value FROM config WHERE name='manifest'");
    }
    if( zVal==0 && g.zConfigDbName ){
      /* No repository setting either, look for a global setting */
      static Stmt q2;
      const char *zRes;
      db_swap_connections();
      db_static_prepare(&q2, 
          "SELECT value FROM global_config WHERE name='manifest'");
      db_swap_connections();
      if( db_step(&q2)==SQLITE_ROW && (zRes = db_column_text(&q2,0))!=0 ){
        zVal = fossil_strdup(zRes);
      }
      db_reset(&q2);
    }
    zCached = zVal;
  }
  if( zVal==0 || is_false(zVal) ){
    return 0;
  }else if( is_truth(zVal) ){
    return MFESTFLG_RAW|MFESTFLG_UUID;
  }
  flg = 0;







<
<
<
<
|
<


<
<

|
|

<
<
|
<
<
<







4085
4086
4087
4088
4089
4090
4091




4092

4093
4094


4095
4096
4097
4098


4099



4100
4101
4102
4103
4104
4105
4106
  char *zVal;
  
  /* Look for the versioned setting first */
  zVal = db_get_versioned("manifest", 0, zCkin);

  if( zVal==0 && g.repositoryOpen ){
    /* No versioned setting, look for the repository setting second */




    zVal = db_text(0, "SELECT value FROM config WHERE name='manifest'");

    if( zVal==0 && g.zConfigDbName ){
      /* No repository setting either, look for a global setting */


      db_swap_connections();
      zVal = db_text(0, 
                 "SELECT value FROM global_config WHERE name='manifest'");
      db_swap_connections();


    }



  }
  if( zVal==0 || is_false(zVal) ){
    return 0;
  }else if( is_truth(zVal) ){
    return MFESTFLG_RAW|MFESTFLG_UUID;
  }
  flg = 0;