Commit 6d8d6afb authored by Michael Widenius's avatar Michael Widenius

Merge with main 5.3

parents b6437d7d 3516b4b5
...@@ -1195,11 +1195,11 @@ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var) ...@@ -1195,11 +1195,11 @@ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var)
*(to++)+= *(from++); *(to++)+= *(from++);
/* Handle the not ulong variables. See end of system_status_var */ /* Handle the not ulong variables. See end of system_status_var */
to_var->bytes_received= from_var->bytes_received; to_var->bytes_received+= from_var->bytes_received;
to_var->bytes_sent+= from_var->bytes_sent; to_var->bytes_sent+= from_var->bytes_sent;
to_var->rows_read+= from_var->rows_read; to_var->rows_read+= from_var->rows_read;
to_var->rows_sent+= from_var->rows_sent; to_var->rows_sent+= from_var->rows_sent;
to_var->binlog_bytes_written= from_var->binlog_bytes_written; to_var->binlog_bytes_written+= from_var->binlog_bytes_written;
to_var->cpu_time+= from_var->cpu_time; to_var->cpu_time+= from_var->cpu_time;
to_var->busy_time+= from_var->busy_time; to_var->busy_time+= from_var->busy_time;
} }
......
...@@ -13426,10 +13426,14 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, ...@@ -13426,10 +13426,14 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
if (thd->is_fatal_error) // If end of memory if (thd->is_fatal_error) // If end of memory
goto err; /* purecov: inspected */ goto err; /* purecov: inspected */
share->db_record_offset= 1; share->db_record_offset= 1;
table->used_for_duplicate_elimination= (param->sum_func_count == 0 &&
(table->group || table->distinct));
if (share->db_type() == TMP_ENGINE_HTON) if (share->db_type() == TMP_ENGINE_HTON)
{ {
if (create_internal_tmp_table(table, param->keyinfo, param->start_recinfo, if (create_internal_tmp_table(table, param->keyinfo, param->start_recinfo,
&param->recinfo, select_options)) &param->recinfo,
select_options))
goto err; goto err;
} }
DBUG_PRINT("info", ("skip_create_table: %d", (int)param->skip_create_table)); DBUG_PRINT("info", ("skip_create_table: %d", (int)param->skip_create_table));
...@@ -13724,11 +13728,23 @@ bool create_internal_tmp_table(TABLE *table, KEY *keyinfo, ...@@ -13724,11 +13728,23 @@ bool create_internal_tmp_table(TABLE *table, KEY *keyinfo,
OPTION_BIG_TABLES) OPTION_BIG_TABLES)
create_info.data_file_length= ~(ulonglong) 0; create_info.data_file_length= ~(ulonglong) 0;
/*
The logic for choosing the record format:
The STATIC_RECORD format is the fastest one, because it's so simple,
so we use this by default for short rows.
BLOCK_RECORD caches both row and data, so this is generally faster than
DYNAMIC_RECORD. The one exception is when we write to tmp table and
want to use keys for duplicate elimination as with BLOCK RECORD
we first write the row, then check for key conflicts and then we have to
delete the row. The cases when this can happen is when there is
a group by and no sum functions or if distinct is used.
*/
if ((error= maria_create(share->table_name.str, if ((error= maria_create(share->table_name.str,
table->no_rows ? NO_RECORD : table->no_rows ? NO_RECORD :
(share->reclength < 64 && (share->reclength < 64 &&
!share->blob_fields ? STATIC_RECORD : !share->blob_fields ? STATIC_RECORD :
BLOCK_RECORD), table->used_for_duplicate_elimination ?
DYNAMIC_RECORD : BLOCK_RECORD),
share->keys, &keydef, share->keys, &keydef,
(uint) (*recinfo-start_recinfo), (uint) (*recinfo-start_recinfo),
start_recinfo, start_recinfo,
...@@ -13973,7 +13989,8 @@ create_internal_tmp_table_from_heap2(THD *thd, TABLE *table, ...@@ -13973,7 +13989,8 @@ create_internal_tmp_table_from_heap2(THD *thd, TABLE *table,
new_table.no_rows= table->no_rows; new_table.no_rows= table->no_rows;
if (create_internal_tmp_table(&new_table, table->key_info, start_recinfo, if (create_internal_tmp_table(&new_table, table->key_info, start_recinfo,
recinfo, thd->lex->select_lex.options | recinfo,
thd->lex->select_lex.options |
thd->options)) thd->options))
goto err2; goto err2;
if (open_tmp_table(&new_table)) if (open_tmp_table(&new_table))
......
...@@ -827,7 +827,7 @@ struct st_table { ...@@ -827,7 +827,7 @@ struct st_table {
See TABLE_LIST::process_index_hints(). See TABLE_LIST::process_index_hints().
*/ */
bool force_index_group; bool force_index_group;
bool distinct,const_table,no_rows; bool distinct,const_table,no_rows, used_for_duplicate_elimination;
/** /**
If set, the optimizer has found that row retrieval should access index If set, the optimizer has found that row retrieval should access index
......
...@@ -204,7 +204,8 @@ int maria_create(const char *name, enum data_file_type datafile_type, ...@@ -204,7 +204,8 @@ int maria_create(const char *name, enum data_file_type datafile_type,
pack_reclength++; pack_reclength++;
not_block_record_extra_length++; not_block_record_extra_length++;
max_field_lengths++; max_field_lengths++;
packed++; if (datafile_type != DYNAMIC_RECORD)
packed++;
column->fill_length= 1; column->fill_length= 1;
options|= HA_OPTION_NULL_FIELDS; /* Use ma_checksum() */ options|= HA_OPTION_NULL_FIELDS; /* Use ma_checksum() */
......
...@@ -42,6 +42,9 @@ EXTRA_DIST = build-vs71.bat build-vs8.bat build-vs8_x64.bat build-vs9.bat \ ...@@ -42,6 +42,9 @@ EXTRA_DIST = build-vs71.bat build-vs8.bat build-vs8_x64.bat build-vs9.bat \
packaging/ca/CustomAction.rc \ packaging/ca/CustomAction.rc \
packaging/WixUIBannerBmp.jpg \ packaging/WixUIBannerBmp.jpg \
packaging/WixUIDialogBmp.jpg \ packaging/WixUIDialogBmp.jpg \
packaging/heidisql.cmake \
packaging/heidisql.wxi.in \
packaging/heidisql_feature.wxi.in\
upgrade_wizard/resource.h \ upgrade_wizard/resource.h \
upgrade_wizard/stdafx.h \ upgrade_wizard/stdafx.h \
upgrade_wizard/targetver.h \ upgrade_wizard/targetver.h \
......
...@@ -103,6 +103,38 @@ IF(WITH_INNOBASE_STORAGE_ENGINE OR WITH_INNODB_STORAGE_ENGINE OR WITH_XTRADB_STO ...@@ -103,6 +103,38 @@ IF(WITH_INNOBASE_STORAGE_ENGINE OR WITH_INNODB_STORAGE_ENGINE OR WITH_XTRADB_STO
SET(EXTRA_WIX_PREPROCESSOR_FLAGS ${EXTRA_WIX_PREPROCESSOR_FLAGS} "-dHaveInnodb=1") SET(EXTRA_WIX_PREPROCESSOR_FLAGS ${EXTRA_WIX_PREPROCESSOR_FLAGS} "-dHaveInnodb=1")
ENDIF() ENDIF()
SET(THIRD_PARTY_FEATURE_CONDITION "")
IF(WITH_THIRD_PARTY)
SET(THIRD_PARTY_DOWNLOAD_LOCATION "$ENV{TEMP}")
IF(THIRD_PARTY_DOWNLOAD_LOCATION)
FILE(TO_CMAKE_PATH "${THIRD_PARTY_DOWNLOAD_LOCATION}" THIRD_PARTY_DOWNLOAD_LOCATION)
ELSE()
SET(THIRD_PARTY_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}")
ENDIF()
ENDIF()
GET_TARGET_PROPERTY(LIBMYSQL_LOCATION libmysql LOCATION)
FOREACH(third_party ${WITH_THIRD_PARTY})
SET(third_party_install_plugin ${CMAKE_CURRENT_SOURCE_DIR}/${third_party}.cmake)
IF(NOT EXISTS ${third_party_install_plugin})
MESSAGE(FATAL_ERROR
"Third party MSI installation plugin ${third_party_install_plugin} does not exist.
It was expected due to WITH_THIRD_PARTY=${WITH_THIRD_PARTY}"
)
ENDIF()
STRING(TOUPPER "${third_party}" upper_third_party)
IF(NOT THIRD_PARTY_FEATURE_CONDITION )
SET(THIRD_PARTY_FEATURE_CONDITION "<Condition Level='0'>${upper_third_party}INSTALLED")
ELSE()
SET(THIRD_PARTY_FEATURE_CONDITION "AND ${upper_third_party}INSTALLED")
ENDIF()
ENDFOREACH()
IF(THIRD_PARTY_FEATURE_CONDITION)
SET(THIRD_PARTY_FEATURE_CONDITION "${THIRD_PARTY_FEATURE_CONDITION}</Condition>")
ENDIF()
IF(NOT CPACK_WIX_UI) IF(NOT CPACK_WIX_UI)
SET(CPACK_WIX_UI "MyWixUI_Mondo") SET(CPACK_WIX_UI "MyWixUI_Mondo")
ENDIF() ENDIF()
...@@ -125,7 +157,6 @@ ENDIF() ...@@ -125,7 +157,6 @@ ENDIF()
ADD_CUSTOM_TARGET( ADD_CUSTOM_TARGET(
MSI MSI
COMMAND set VS_UNICODE_OUTPUT=
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
${CONFIG_PARAM} ${CONFIG_PARAM}
-P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake -P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
...@@ -134,7 +165,6 @@ ADD_DEPENDENCIES(MSI wixca) ...@@ -134,7 +165,6 @@ ADD_DEPENDENCIES(MSI wixca)
ADD_CUSTOM_TARGET( ADD_CUSTOM_TARGET(
MSI_ESSENTIALS MSI_ESSENTIALS
COMMAND set VS_UNICODE_OUTPUT=
COMMAND ${CMAKE_COMMAND} -DESSENTIALS=1 COMMAND ${CMAKE_COMMAND} -DESSENTIALS=1
${CONFIG_PARAM} ${CONFIG_PARAM}
-P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake -P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
......
...@@ -23,7 +23,30 @@ SET(SIGNTOOL_PARAMETERS "@SIGNTOOL_PARAMETERS@") ...@@ -23,7 +23,30 @@ SET(SIGNTOOL_PARAMETERS "@SIGNTOOL_PARAMETERS@")
SET(CMAKE_FULL_VER SET(CMAKE_FULL_VER
"@CMAKE_MAJOR_VERSION@.@CMAKE_MINOR_VERSION@.@CMAKE_PATCH_VERSION@") "@CMAKE_MAJOR_VERSION@.@CMAKE_MINOR_VERSION@.@CMAKE_PATCH_VERSION@")
SET(EXTRA_WIX_PREPROCESSOR_FLAGS "@EXTRA_WIX_PREPROCESSOR_FLAGS@") SET(EXTRA_WIX_PREPROCESSOR_FLAGS "@EXTRA_WIX_PREPROCESSOR_FLAGS@")
SET(WITH_THIRD_PARTY "@WITH_THIRD_PARTY@")
SET(THIRD_PARTY_DOWNLOAD_LOCATION "@THIRD_PARTY_DOWNLOAD_LOCATION@")
SET(THIRD_PARTY_FEATURE_CONDITION "@THIRD_PARTY_FEATURE_CONDITION@")
SET(LIBMYSQL_LOCATION "@LIBMYSQL_LOCATION@")
SET($ENV{VS_UNICODE_OUTPUT} "")
IF(LIBMYSQL_LOCATION AND CMAKE_CFG_INTDIR)
# resolve libmysql full path
STRING(REPLACE "${CMAKE_CFG_INTDIR}" "${CMAKE_INSTALL_CONFIG_NAME}" LIBMYSQL_LOCATION "${LIBMYSQL_LOCATION}")
ENDIF()
FOREACH(third_party ${WITH_THIRD_PARTY})
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/${third_party}.cmake)
# Check than above script produced ${third_party}.wxi and ${third_party}_feature.wxi
FOREACH(outfile ${third_party}.wxi ${third_party}_feature.wxi)
IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${outfile})
MESSAGE(FATAL_ERROR
"${CMAKE_CURRENT_SOURCE_DIR}/${third_party}.cmake did not produce "
"${CMAKE_CURRENT_BINARY_DIR}/${outfile}"
)
ENDIF()
ENDFOREACH()
ENDFOREACH()
IF(CMAKE_SIZEOF_VOID_P EQUAL 8) IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
......
...@@ -46,6 +46,9 @@ ...@@ -46,6 +46,9 @@
<Property Id="CLEANUPDATA" Secure="yes" Value="1"/> <Property Id="CLEANUPDATA" Secure="yes" Value="1"/>
<!-- Force per machine installation --> <!-- Force per machine installation -->
<Property Id="ALLUSERS" Secure="yes" Value="1"/> <Property Id="ALLUSERS" Secure="yes" Value="1"/>
<!-- Disable advertised shortcuts weirdness -->
<Property Id="DISABLEADVTSHORTCUTS" Secure="yes" Value="1"/>
<?if $(var.HaveInnodb) = "1" ?> <?if $(var.HaveInnodb) = "1" ?>
<!-- Quick configuration : set default storage engine to innodb, use strict sql_mode --> <!-- Quick configuration : set default storage engine to innodb, use strict sql_mode -->
<Property Id="STDCONFIG" Secure="yes" Value="1"/> <Property Id="STDCONFIG" Secure="yes" Value="1"/>
...@@ -567,6 +570,38 @@ ...@@ -567,6 +570,38 @@
<?endif?> <?endif?>
</Feature> </Feature>
<!-- Optional 3rd party tools -->
<DirectoryRef Id='TARGETDIR'>
<Directory Id='CommonFilesFolder'>
<Directory Id='MariaDBShared' Name='MariaDBShared'/>
</Directory>
<Directory Id='DesktopFolder'/>
</DirectoryRef>
<?if "@WITH_THIRD_PARTY@" != "" ?>
<!-- Include definition of 3party components -->
<?foreach tool in @WITH_THIRD_PARTY@ ?>
<?include "${CMAKE_CURRENT_BINARY_DIR}\$(var.tool).wxi" ?>
<?endforeach ?>
<Feature Id="ThirdPartyTools"
Title='Third party tools'
Description= 'Third party tools'
AllowAdvertise='no'
Level='1'
Display='expand'>
@THIRD_PARTY_FEATURE_CONDITION@
<!-- Include definition of 3rd party features -->
<?foreach tool in @WITH_THIRD_PARTY@ ?>
<?include "${CMAKE_CURRENT_BINARY_DIR}\$(var.tool)_feature.wxi" ?>
<?endforeach ?>
</Feature>
<?endif ?>
<!-- Custom action, call mysql_install_db --> <!-- Custom action, call mysql_install_db -->
<SetProperty Sequence='execute' Before='CreateDatabaseCommand' Id="SKIPNETWORKING" Value="--skip-networking" >SKIPNETWORKING</SetProperty> <SetProperty Sequence='execute' Before='CreateDatabaseCommand' Id="SKIPNETWORKING" Value="--skip-networking" >SKIPNETWORKING</SetProperty>
<SetProperty Sequence='execute' Before='CreateDatabaseCommand' Id="ALLOWREMOTEROOTACCESS" Value="--allow-remote-root-access">ALLOWREMOTEROOTACCESS</SetProperty> <SetProperty Sequence='execute' Before='CreateDatabaseCommand' Id="ALLOWREMOTEROOTACCESS" Value="--allow-remote-root-access">ALLOWREMOTEROOTACCESS</SetProperty>
......
SET(HEIDISQL_BASE_NAME "HeidiSQL_6.0_Portable")
SET(HEIDISQL_ZIP "${HEIDISQL_BASE_NAME}.zip")
SET(HEIDISQL_URL "http://heidisql.googlecode.com/files/${HEIDISQL_ZIP}")
SET(HEIDISQL_DOWNLOAD_DIR ${THIRD_PARTY_DOWNLOAD_LOCATION}/${HEIDISQL_BASE_NAME})
IF(NOT EXISTS ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP})
MAKE_DIRECTORY(${HEIDISQL_DOWNLOAD_DIR})
MESSAGE(STATUS "Downloading ${HEIDISQL_URL} to ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}")
FILE(DOWNLOAD ${HEIDISQL_URL} ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP} TIMEOUT 60)
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E chdir ${HEIDISQL_DOWNLOAD_DIR}
${CMAKE_COMMAND} -E tar xfz ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}
)
ENDIF()
SET(LIBMYSQLDLL_SOURCE ${HEIDISQL_DOWNLOAD_DIR}/libmysql.dll)
IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
# Use our libmysql if it is 32 bit.
IF(LIBMYSQL_LOCATION)
SET(LIBMYSQLDLL_SOURCE "${LIBMYSQL_LOCATION}")
ENDIF()
ENDIF()
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql.wxi)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql_feature.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql_feature.wxi)
<Include>
<Property Id="HEIDISQLINSTALLED" Secure="yes">
<RegistrySearch Id="HeidiSQL"
Root="HKLM"
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\HeidiSQL_is1"
Name="Install"
Type="raw"
Win64="no"
/>
</Property>
<DirectoryRef Id="MariaDBShared">
<Directory Id="D.HeidiSQL" Name="HeidiSQL">
<Component Id="component.HeidiSQL" Guid="96ea3879-5320-4098-8f26-2f655d2f716c" Win64="no">
<File Id="heidisql.gpl.txt" Name="gpl.txt" Source="${HEIDISQL_DOWNLOAD_DIR}\gpl.txt" />
<File Id="heidisql.heidisql.exe" Name="heidisql.exe" Source="${HEIDISQL_DOWNLOAD_DIR}\heidisql.exe" KeyPath="yes">
<Shortcut Id="desktopHeidiSQL" Directory="DesktopFolder" Name="HeidiSQL" Advertise="yes"/>
</File>
<!--
Forced file removal for heidisql.exe might be required.
HeidiSQL is self-updating, thus the version that was installed by MSI not necessarily matches
the version of the file on uninstall. MSI would not touch such file by default and leave it after
uninstallation. We use RemoveFile to force delete in any case.
-->
<RemoveFile Id="Remove_HeidiSQL_exe" Name="heidisql.exe" On="uninstall" />
<File Id="heidisql.license.txt" Name="license.txt" Source="${HEIDISQL_DOWNLOAD_DIR}\license.txt" />
<File Id="heidisql.readme.txt" Name="readme.txt" Source="${HEIDISQL_DOWNLOAD_DIR}\readme.txt" />
</Component>
<Component Id="component.HeidiSQL_MenuShortcut" Guid="*" Win64="no">
<RegistryValue Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall" Name="shortcuts.heidisql" Value="1" Type="string" KeyPath="yes" />
<Shortcut Id="startmenuHeidiSQL" Directory="ShortcutFolder" Name="HeidiSQL" Target="[D.HeidiSQL]\heidisql.exe"/>
<RemoveRegistryKey Id="HeidiSQL_RegistryCleanup" Root="HKCU" Key="SOFTWARE\HeidiSQL" Action="removeOnUninstall" />
</Component>
<Component Id="component.HeidiSQL_libmysql.dll" Guid="*" Win64="no">
<File Id="heidisql.libmysql.dll" Name="libmysql.dll" Source="${HEIDISQL_DOWNLOAD_DIR}\libmysql.dll" />
</Component>
</Directory>
</DirectoryRef>
<ComponentGroup Id="HeidiSQL">
<ComponentRef Id="component.HeidiSQL"/>
<ComponentRef Id="component.HeidiSQL_MenuShortcut"/>
<ComponentRef Id="component.HeidiSQL_libmysql.dll"/>
</ComponentGroup>
</Include>
<Include>
<Feature Id="HeidiSQL"
Title='HeidiSQL'
Description= 'Powerful, easy and free MySQL/MariaDB GUI client by Ansgar Becker'
AllowAdvertise='no'
Level='1'>
<Condition Level="0">HEIDISQLINSTALLED</Condition>
<ComponentGroupRef Id='HeidiSQL'/>
</Feature>
</Include>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment