You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/11/08 06:47:58 UTC

[GitHub] [incubator-doris] yangzhg opened a new pull request #7041: [enhancement] Increase compatibility with mysql

yangzhg opened a new pull request #7041:
URL: https://github.com/apache/incubator-doris/pull/7041


   ## Proposed changes
   
   Increase compatibility with mysql
     1. Added two system tables files and partitions
     2. Improved the return logic of mysql error code to make the error code more compatible with mysql
     3. Added lock/unlock tables statement and show columns statement for compatibility with mysql dump
     4. Compatible with mysqldump tool
   ## Types of changes
   
   What types of changes does your code introduce to Doris?
   _Put an `x` in the boxes that apply_
   
   - [ ] Bugfix (non-breaking change which fixes an issue)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
   - [ ] Documentation Update (if none of the other choices apply)
   - [ ] Code refactor (Modify the code structure, format the code, etc...)
   - [x] Optimization. Including functional usability improvements and performance improvements.
   - [ ] Dependency. Such as changes related to third-party components.
   - [ ] Other.
   
   ## Checklist
   
   _Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
   
   - [ ] I have created an issue on (Fix #ISSUE) and described the bug/feature there in detail
   - [ ] Compiling and unit tests pass locally with my changes
   - [ ] I have added tests that prove my fix is effective or that my feature works
   - [ ] If these changes need document changes, I have updated the document
   - [ ] Any dependent changes have been merged
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman merged pull request #7041: [enhancement] Increase compatibility with mysql

Posted by GitBox <gi...@apache.org>.
morningman merged pull request #7041:
URL: https://github.com/apache/incubator-doris/pull/7041


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on a change in pull request #7041: [enhancement] Increase compatibility with mysql

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #7041:
URL: https://github.com/apache/incubator-doris/pull/7041#discussion_r747580205



##########
File path: be/src/exec/schema_scanner/schema_files_scanner.cpp
##########
@@ -0,0 +1,115 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "exec/schema_scanner/schema_files_scanner.h"
+
+#include "exec/schema_scanner/schema_helper.h"
+#include "runtime/primitive_type.h"
+#include "runtime/string_value.h"
+
+namespace doris {
+
+SchemaScanner::ColumnDesc SchemaFilesScanner::_s_tbls_columns[] = {
+        //   name,       type,          size,     is_null
+        {"FILE_ID", TYPE_BIGINT, sizeof(int64_t), true},
+        {"FILE_NAME", TYPE_STRING, sizeof(StringValue), true},
+        {"FILE_TYPE", TYPE_VARCHAR, sizeof(StringValue), true},
+        {"TABLESPACE_NAME", TYPE_VARCHAR, sizeof(StringValue), false},
+        {"TABLE_CATALOG", TYPE_CHAR, sizeof(StringValue), false},
+        {"TABLE_SCHEMA", TYPE_STRING, sizeof(StringValue), true},
+        {"TABLE_NAME", TYPE_STRING, sizeof(StringValue), true},
+        {"LOGFILE_GROUP_NAME", TYPE_VARCHAR, sizeof(StringValue), true},
+        {"LOGFILE_GROUP_NUMBER", TYPE_BIGINT, sizeof(int64_t), true},
+        {"ENGINE", TYPE_VARCHAR, sizeof(StringValue), false},
+        {"FULLTEXT_KEYS", TYPE_STRING, sizeof(StringValue), true},
+        {"DELETED_ROWS", TYPE_STRING, sizeof(StringValue), true},
+        {"UPDATE_COUNT", TYPE_STRING, sizeof(StringValue), true},
+        {"FREE_EXTENTS", TYPE_BIGINT, sizeof(int64_t), true},
+        {"TOTAL_EXTENTS", TYPE_BIGINT, sizeof(int64_t), true},
+        {"EXTENT_SIZE", TYPE_BIGINT, sizeof(int64_t), true},
+        {"INITIAL_SIZE", TYPE_BIGINT, sizeof(int64_t), true},
+        {"MAXIMUM_SIZE", TYPE_BIGINT, sizeof(int64_t), true},
+        {"AUTOEXTEND_SIZE", TYPE_BIGINT, sizeof(int64_t), true},
+        {"CREATION_TIME", TYPE_STRING, sizeof(StringValue), true},
+        {"LAST_UPDATE_TIME", TYPE_STRING, sizeof(StringValue), true},
+        {"LAST_ACCESS_TIME", TYPE_STRING, sizeof(StringValue), true},
+        {"RECOVER_TIME", TYPE_STRING, sizeof(StringValue), true},
+        {"TRANSACTION_COUNTER", TYPE_STRING, sizeof(StringValue), true},
+        {"VERSION", TYPE_BIGINT, sizeof(int64_t), true},
+        {"ROW_FORMAT", TYPE_VARCHAR, sizeof(StringValue), true},
+        {"TABLE_ROWS", TYPE_STRING, sizeof(StringValue), true},
+        {"AVG_ROW_LENGTH", TYPE_STRING, sizeof(StringValue), true},
+        {"DATA_LENGTH", TYPE_STRING, sizeof(StringValue), true},
+        {"MAX_DATA_LENGTH", TYPE_STRING, sizeof(StringValue), true},
+        {"INDEX_LENGTH", TYPE_STRING, sizeof(StringValue), true},
+        {"DATA_FREE", TYPE_BIGINT, sizeof(int64_t), true},
+        {"CREATE_TIME", TYPE_STRING, sizeof(StringValue), true},
+        {"UPDATE_TIME", TYPE_STRING, sizeof(StringValue), true},
+        {"CHECK_TIME", TYPE_STRING, sizeof(StringValue), true},
+        {"CHECKSUM", TYPE_STRING, sizeof(StringValue), true},
+        {"STATUS", TYPE_VARCHAR, sizeof(StringValue), true},
+        {"EXTRA", TYPE_VARCHAR, sizeof(StringValue), true},
+};
+
+SchemaFilesScanner::SchemaFilesScanner()
+        : SchemaScanner(_s_tbls_columns,
+                        sizeof(_s_tbls_columns) / sizeof(SchemaScanner::ColumnDesc)),
+          _db_index(0),
+          _table_index(0) {}
+
+SchemaFilesScanner::~SchemaFilesScanner() {}
+
+Status SchemaFilesScanner::start(RuntimeState* state) {
+    if (!_is_init) {
+        return Status::InternalError("used before initialized.");
+    }
+    TGetDbsParams db_params;
+    if (NULL != _param->db) {

Review comment:
       nullptr?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] github-actions[bot] commented on pull request #7041: [enhancement] Increase compatibility with mysql

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #7041:
URL: https://github.com/apache/incubator-doris/pull/7041#issuecomment-973664583






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman merged pull request #7041: [enhancement] Increase compatibility with mysql

Posted by GitBox <gi...@apache.org>.
morningman merged pull request #7041:
URL: https://github.com/apache/incubator-doris/pull/7041


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org