2017-03-31 43 views
2

不正な形式のsqliteファイルをきれいにエクスポート/インポートしようとしています。 techblog.dorogin.com/sqliteexception-datab...からの情報を使用してSqliteエラー:式のツリーが大きすぎます(最大深度1000)

が、これは私がsqlite3 oldfileやったことです:

  1. .mode insert
  2. .output tempfile
  3. .dump

それから私は、新しいsqlite3 newfileを作成しました:

  • .read tempfile

エラー:出力ファイルの

sqlite> .read tempfile 
Error: near line 52330: Expression tree is too large (maximum depth 1000) 
Error: near line 53097: Expression tree is too large (maximum depth 1000) 
Error: near line 53427: Expression tree is too large (maximum depth 1000) 
Error: near line 54013: Expression tree is too large (maximum depth 1000) 
Error: near line 54014: Expression tree is too large (maximum depth 1000) 
Error: near line 54047: Expression tree is too large (maximum depth 1000) 
Error: near line 54048: Expression tree is too large (maximum depth 1000) 
Error: near line 54227: Expression tree is too large (maximum depth 1000) 
Error: near line 54294: Expression tree is too large (maximum depth 1000) 
Error: near line 54373: Expression tree is too large (maximum depth 1000) 
Error: near line 54374: Expression tree is too large (maximum depth 1000) 
Error: near line 56688: Expression tree is too large (maximum depth 1000) 
Error: near line 57950: Expression tree is too large (maximum depth 1000) 
Error: near line 58015: Expression tree is too large (maximum depth 1000) 
Error: near line 58077: Expression tree is too large (maximum depth 1000) 
Error: near line 58246: Expression tree is too large (maximum depth 1000) 
Error: near line 59795: Expression tree is too large (maximum depth 1000) 
Error: near line 60439: Expression tree is too large (maximum depth 1000) 
Error: near line 61501: Expression tree is too large (maximum depth 1000) 
Error: near line 61523: Expression tree is too large (maximum depth 1000) 
Error: near line 61811: Expression tree is too large (maximum depth 1000) 
Error: near line 61824: Expression tree is too large (maximum depth 1000) 

、私の最大のラインは35737文字です。

このエラーを修正するにはどうすればよいですか?

不正な形式のsqliteファイルをきれいにエクスポート/インポートするにはどうすればよいですか?

+0

は、あなたがそれをググありますか? 1つのクエリで1,000以上の条件が表示されるようです。 –

+0

@juergend、そうです、解決策が必要です。 – Pacerier

+0

違反行を表示してください。 –

答えて

3

これはバージョン3.18.0でのsqlite3changeによるものです:

In the output of the ".dump" command in the CLI, quote newline and carriage-return characters using the char() function, so that they do not get eaten by end-of-line processing logic in the OS or in other command-line utilities and/or libraries.

あまりにも多くの改行文字は単一の文字列値である場合、結果のSQL式が複雑になりすぎます。

これは3.19.0fixedでした。 あなたはまだあなたが代わりに生の改行を使用するようにファイルを変換することによってこの問題を回避することができ、3.18.0を使用している場合:

sed -e "s/'||char(10)||'/\\n/g" <tempfile> tempfile_with_newlines 
+0

このスレッドレポートのために、彼らはただ3.19で修正しましたか? – Pacerier

+0

はい。これに基づくバグレポートが最初のものでした。 –

関連する問題