やってみる

アウトプットすべく己を導くためのブログ。その試行錯誤すらたれ流す。

SQLite3ドットコマンド(.testctrl)

 わけわからん。

.help testctrl

sqlite3 :memory: ".help testctrl"
.testctrl CMD ...        Run various sqlite3_test_control() operations
                           Run ".testctrl" with no arguments for details
sqlite3 :memory: ".testctrl"
Available test-controls:
  .testctrl always BOOLEAN
  .testctrl assert BOOLEAN
  .testctrl byteorder 
  .testctrl imposter SCHEMA ON/OFF ROOTPAGE
  .testctrl internal_functions BOOLEAN
  .testctrl localtime_fault BOOLEAN
  .testctrl never_corrupt BOOLEAN
  .testctrl optimizations DISABLE-MASK
  .testctrl pending_byte OFFSET  
  .testctrl prng_reset 
  .testctrl prng_restore 
  .testctrl prng_save 
  .testctrl reserve BYTES-OF-RESERVE

 以前、頑張ってみた記憶がある。

 リリースノートみてみたら、今使っている最新3.29.0から追加されたコマンドらしい。

assert

 真偽値によって合否判定するのか? と思ったが謎。

 trueはエラー。

sqlite3 :memory: ".testctrl assert true"
ERROR: Not a boolean value: "true". Assuming "no".
0

 「noと仮定する」というのでyes/noを使うのか?

sqlite3 :memory: ".testctrl assert no"
0

 だがyesにしても出力は同じ0。は?

sqlite3 :memory: ".testctrl assert yes"
0

 0, 1も同様。

sqlite3 :memory: ".testctrl assert 1"
0
sqlite3 :memory: ".testctrl assert 0"
0

 なにこれ。説明求む。ググっても情報なし。

 ソースコードを少し見てみたがわからん。sqlite3_test_control関数の所在が不明。どこにある? 何する?

 もはやコナミコマンド並の裏コマンド的な何か。

所感

 だれかがネットで解説してくれるのを待とう。私には無理。

対象環境

$ uname -a
Linux raspberrypi 4.19.42-v7+ #1218 SMP Tue May 14 00:48:17 BST 2019 armv7l GNU/Linux

前回まで