Code Monkey home page Code Monkey logo

Comments (3)

Qiuwen-chen avatar Qiuwen-chen commented on June 1, 2024

It's a long story. Has this affected you in any way?

from wcdb.

oqsh avatar oqsh commented on June 1, 2024

对的,因为我这边升级WCDBOptimizedSQLCipher后出了个问题: 因为SQL语句中的参数过多导致执行失败, 出错代码如下:

NSMutableArray<NSString *> *binds = @{}.mutableCopy;
NSUInteger count = nameIDs.count;// count数量为200
for (NSUInteger index = 0; index < count; index++ ) {
    [binds addObject:@"?"];
}
NSString *sql = [NSString stringWithFormat:@"DELETE FROM %@ WHERE name_id IN (%@);", tableName, [binds componentsJoinedByString:@","]];
FMDatabase *db = self.database;
NSError *error = nil;
[db executeUpdate:sql values:trackIDs error:&error];

然后我修复了这个参数过多导致SQL语句执行失败的问题(不使用 ? 代替in后面的内容),修复代码如下:

NSString *sql =[NSString stringWithFormat:@"DELETE FROM %@ WHERE name_id IN ( '%@' );", tableName, [nameIDs componentsJoinedByString:@"','"]];

但是因为我的项目中代码量很大,不确定其他地方是否会有类似问题 && 难以确保后面其他研发是否会这样裸用sql,
所以我这边计划把WCDBOptimizedSQLCipher的podspec中的SQLITE_MAX_VARIABLE_NUMBER=99这句干掉。

可我又不确定把这个宏干掉后,会不会导致WCDB、WCDBOptimizedSQLCipher这两个SDK出现其他问题,所以才会有本次提问的问题

from wcdb.

Qiuwen-chen avatar Qiuwen-chen commented on June 1, 2024

If you don't use the data migration feature in WCDB, this will not have a negative impact.

from wcdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.