Skip to content

Commit

Permalink
fix: also handle "type" for data type
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Dec 1, 2022
1 parent 668ece2 commit 7f6c3a7
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
19 changes: 19 additions & 0 deletions src/rust/data/mariadb_test_case_13.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<h4 class="anchored_heading" id="system_versioning_insert_history">system_versioning_insert_history</h4>
<ul start="1">
<li><strong>Description:</strong> Allows direct inserts into ROW_START and ROW_END columns if <a
href="/kb/en/server-system-variables/#secure_timestamp">secure_timestamp</a> allows changing <a
href="/kb/en/server-system-variables/#timestamp">timestamp</a>.
</li>
<li><strong>Commandline:</strong> <code>--system-versioning-insert-history[={0|1}]</code>
</li>
<li><strong>Scope:</strong> Global, Session
</li>
<li><strong>Dynamic:</strong> Yes
</li>
<li><strong>Type:</strong> Boolean
</li>
<li><strong>Default Value:</strong> <code>OFF</code>
</li>
<li><strong>Introduced:</strong> <a href="/kb/en/mariadb-10-11-0-release-notes/">MariaDB 10.11.0</a>
</li>
</ul>
26 changes: 25 additions & 1 deletion src/rust/mariadb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ fn process_li(mut entry: KbParsedEntry, li_node: Node) -> KbParsedEntry {
"dynamic" => {
entry.dynamic = Some(row_value.to_lowercase() == "yes");
}
"data type" => {
"data type" | "type" => {
entry.r#type = Some(row_value.to_lowercase().trim().to_string());

if entry.r#type != Some("".to_string()) {
Expand Down Expand Up @@ -868,4 +868,28 @@ mod tests {
entries
);
}

#[test]
fn test_case_13() {
let entries = extract_mariadb_from_text(QueryResponse {
body: get_test_data("mariadb_test_case_13.html"),
url: "https://example.com",
});

assert_eq!(
vec![KbParsedEntry {
has_description: true,
cli: Some("--system-versioning-insert-history[={0|1}]".to_string()),
default: Some("OFF".to_string()),
dynamic: Some(true),
id: "system_versioning_insert_history".to_string(),
name: Some("system_versioning_insert_history".to_string()),
scope: Some(vec!["global".to_string(), "session".to_string()]),
r#type: Some("boolean".to_string()),
valid_values: None,
range: None,
},],
entries
);
}
}

0 comments on commit 7f6c3a7

Please sign in to comment.